Skip to content

Commit 086bd74

Browse files
use list comp rather than filter
1 parent aee006c commit 086bd74

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/cr/cube/dimension.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,12 +875,11 @@ def _replaced_order_element_ids(self, element_ids) -> List[Optional[str]]:
875875
The explicit order transform includes a list of ids that can be specified in
876876
many different ways, this translate them to the subvariable aliases.
877877
"""
878-
return list(
879-
filter(
880-
lambda v: v is not None,
881-
[self.translate_element_id(_id) for _id in element_ids],
882-
)
883-
)
878+
return [
879+
el
880+
for _id in element_ids
881+
if (el := self.translate_element_id(_id)) is not None
882+
]
884883

885884
@lazyproperty
886885
def _subvar_aliases(self) -> Tuple[str, ...]:

0 commit comments

Comments
 (0)