Skip to content

Commit

Permalink
#280 related, removing non utilized by_id indexation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Feb 14, 2022
1 parent 93282e2 commit 7536ad9
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions arekit/common/entities/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ def __init__(self, entities, value_to_group_id_func):
entities=entities,
key_func=lambda e: value_to_group_id_func(e.Value))

self.__by_id = self.create_index(entities=entities,
key_func=lambda e: e.IdInDocument)

@staticmethod
def __value_or_none(d, key):
return d[key] if key in d else None
Expand Down Expand Up @@ -61,13 +58,6 @@ def try_get_entities(self, value, group_key):
if group_key == self.KeyType.BY_VALUE:
return self.__value_or_none(self.__by_value, value)

def get_entity_by_id(self, id):
assert(isinstance(id, int))

value = self.__by_id[id]
assert(len(value) == 1)
return value[0]

# endregion

# region base methods
Expand Down

0 comments on commit 7536ad9

Please sign in to comment.