mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
combine id and key+alias string for key
This commit is contained in:
parent
76940fd72f
commit
3d94fab1f5
1 changed files with 5 additions and 4 deletions
|
|
@ -318,15 +318,16 @@ def regex_tuple_from_key_alias(obj):
|
|||
|
||||
"""
|
||||
global _REGEX_TUPLE_CACHE
|
||||
permutation_string = " ".join([obj.key] + obj.aliases.all())
|
||||
cache_key = " ".join((obj.id, permutation_string))
|
||||
|
||||
if obj.id not in _REGEX_TUPLE_CACHE:
|
||||
permutation_string = " ".join([obj.key] + obj.aliases.all())
|
||||
_REGEX_TUPLE_CACHE[obj.id] = (
|
||||
if cache_key not in _REGEX_TUPLE_CACHE:
|
||||
_REGEX_TUPLE_CACHE[cache_key] = (
|
||||
re.compile(ordered_permutation_regex(permutation_string), _RE_FLAGS),
|
||||
obj,
|
||||
obj.key,
|
||||
)
|
||||
return _REGEX_TUPLE_CACHE[obj.id]
|
||||
return _REGEX_TUPLE_CACHE[cache_key]
|
||||
|
||||
|
||||
def parse_language(speaker, emote):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue