Skip to content

Commit 531bdf0

Browse files
authored
Improve loop idiom
1 parent 1636d85 commit 531bdf0

File tree

1 file changed

+1
-6
lines changed
  • hypothesis-python/src/hypothesis/internal/conjecture

1 file changed

+1
-6
lines changed

hypothesis-python/src/hypothesis/internal/conjecture/datatree.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,8 @@ def all_children(ir_type, kwargs):
305305
else:
306306
yield from [False, True]
307307
if ir_type == "bytes":
308-
min_size = kwargs["min_size"]
309-
max_size = kwargs["max_size"]
310-
311-
size = min_size
312-
while size <= max_size:
308+
for size in range(kwargs["min_size"], kwargs["max_size"] + 1):
313309
yield from (int_to_bytes(i, size) for i in range(2 ** (8 * size)))
314-
size += 1
315310
if ir_type == "string":
316311
min_size = kwargs["min_size"]
317312
max_size = kwargs["max_size"]

0 commit comments

Comments
 (0)