Skip to content

Commit

Permalink
Merge pull request #261 from DimitriPapadopoulos/PTC-W0060
Browse files Browse the repository at this point in the history
Implicit enumerate call
  • Loading branch information
FrancescAlted authored Sep 23, 2024
2 parents 3d34a2e + 768e918 commit 4615a38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/blosc2/lazyexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,13 +1225,13 @@ def fuse_expressions(expr, new_base, dup_op):
skip_to_char = 0
old_base = 0
prev_pos = {}
for i in range(len(expr)):
for i, expr_i in enumerate(expr):
if i < skip_to_char:
continue
if expr[i] == "o":
if expr_i == "o":
if i > 0 and (expr[i - 1] != " " and expr[i - 1] != "("):
# Not a variable
new_expr += expr[i]
new_expr += expr_i
continue
# This is a variable. Find the end of it.
j = i + 1
Expand All @@ -1256,7 +1256,7 @@ def fuse_expressions(expr, new_base, dup_op):
new_expr += dup_op[old_op]
skip_to_char = i + j + 1
else:
new_expr += expr[i]
new_expr += expr_i
return new_expr


Expand Down

0 comments on commit 4615a38

Please sign in to comment.