Remove redundant entity cache

Progress towards #3989.
May also help with #3235.
This commit is contained in:
Lonami Exo
2023-04-06 13:09:07 +02:00
parent 3e64ea35ff
commit f7e38ee6f0
14 changed files with 35 additions and 32 deletions

View File

@@ -585,9 +585,9 @@ def _get_entity_pair(entity_id, entities, cache,
"""
entity = entities.get(entity_id)
try:
input_entity = cache[entity_id]
except KeyError:
# KeyError is unlikely, so another TypeError won't hurt
input_entity = cache.get(resolve_id(entity_id)[0])._as_input_peer()
except AttributeError:
# AttributeError is unlikely, so another TypeError won't hurt
try:
input_entity = get_input_peer(entity)
except TypeError: