Skip to content

Commit f696627

Browse files
Replace loop with lisyt comprehension
Co-authored-by: Sadie L. Bartholomew <[email protected]>
1 parent ade8003 commit f696627

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cf/field.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,8 @@ def __getitem__(self, indices):
454454
# below.
455455
if org_cyclic:
456456
new_cyclic = new_data.cyclic()
457-
for i in org_cyclic:
458-
if i not in new_cyclic:
459-
new.cyclic(i, iscyclic=False)
457+
[new.cyclic(i, iscyclic=False) for i in org_cyclic if i not in new_cyclic]
458+
460459

461460
# ------------------------------------------------------------
462461
# Subspace constructs with data

0 commit comments

Comments
 (0)