Island: Use list comprehension instead of list(map())

This commit is contained in:
Mike Salvatore 2022-09-30 14:35:30 -04:00
parent f9e74d4f03
commit c29d90aa5f
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ class MongoNodeRepository(INodeRepository):
def get_nodes(self) -> Sequence[Node]:
try:
cursor = self._nodes_collection.find({}, {MONGO_OBJECT_ID_KEY: False})
return list(map(lambda n: Node(**n), cursor))
return [Node(**n) for n in cursor]
except Exception as err:
raise RetrievalError(f"Error retrieving nodes from the repository: {err}")