Skip to content

Commit

Permalink
refactoring skip looping with next
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Feb 1, 2023
1 parent abe8203 commit 2852bef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyteal/ast/abi/tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ def get_or_store(self, index: int, output: BaseType | None = None) -> Expr:
ignoreNext = 0
lastBoolStart = 0
lastBoolLength = 0
for i, typeBefore in enumerate(self.value_types[:index]):
for i, typeBefore in (enum_iter := enumerate(self.value_types[:index])):
# fast forward until `ignoreNext` are all used up or reaching `index`
if ignoreNext > 0:
ignoreNext -= 1
while next(enum_iter, None) and ignoreNext > 0:
ignoreNext -= 1
continue

if typeBefore == BoolTypeSpec():
Expand Down

0 comments on commit 2852bef

Please sign in to comment.