forked from p15670423/monkey
Island: Use list comprehension instead of list(map())
This commit is contained in:
parent
f9e74d4f03
commit
c29d90aa5f
|
@ -73,7 +73,7 @@ class MongoNodeRepository(INodeRepository):
|
||||||
def get_nodes(self) -> Sequence[Node]:
|
def get_nodes(self) -> Sequence[Node]:
|
||||||
try:
|
try:
|
||||||
cursor = self._nodes_collection.find({}, {MONGO_OBJECT_ID_KEY: False})
|
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:
|
except Exception as err:
|
||||||
raise RetrievalError(f"Error retrieving nodes from the repository: {err}")
|
raise RetrievalError(f"Error retrieving nodes from the repository: {err}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue