mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Apply suggestions from code review
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
402213bf41
commit
995cc615a0
@ -187,7 +187,7 @@ class PushRuleEvaluatorForEvent:
|
|||||||
# Caches (string, is_glob, word_boundary) -> regex for push. See _glob_matches
|
# Caches (string, is_glob, word_boundary) -> regex for push. See _glob_matches
|
||||||
regex_cache = LruCache(
|
regex_cache = LruCache(
|
||||||
50000, "regex_push_cache"
|
50000, "regex_push_cache"
|
||||||
) # type: LruCache[Tuple[str, bool, bool],Pattern]
|
) # type: LruCache[Tuple[str, bool, bool], Pattern]
|
||||||
|
|
||||||
|
|
||||||
def _glob_matches(glob: str, value: str, word_boundary: bool = False) -> bool:
|
def _glob_matches(glob: str, value: str, word_boundary: bool = False) -> bool:
|
||||||
|
@ -283,7 +283,7 @@ class LruCache(Generic[KT, VT]):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def cache_pop(key: KT, default: Literal[None] = None) -> Union[None, VT]:
|
def cache_pop(key: KT, default: Literal[None] = None) -> Optional[VT]:
|
||||||
...
|
...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
Loading…
Reference in New Issue
Block a user