Skip to content
Snippets Groups Projects
Commit 5453da3f authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Improve lookup algorithm by removing set

parent 9781f555
No related branches found
No related tags found
No related merge requests found
Pipeline #14770 passed with warnings
......@@ -608,7 +608,6 @@ def _find_in_range(rec_stages, min_stage, max_stage, builder):
awkward1 Array builder.
"""
valid_stages = set(range(min_stage, max_stage))
for s in rec_stages:
builder.begin_list()
for i in s:
......@@ -616,7 +615,7 @@ def _find_in_range(rec_stages, min_stage, max_stage, builder):
if num_stages != 0:
found = 0
for j in i:
if j in valid_stages:
if min_stage <= j <= max_stage:
found += 1
if found == num_stages:
builder.append(1)
......@@ -645,14 +644,13 @@ def _find_in_range_single(rec_stages, min_stage, max_stage, builder):
builder : awkward1.highlevel.ArrayBuilder
awkward1 Array builder.
"""
valid_stages = set(range(min_stage, max_stage))
builder.begin_list()
for s in rec_stages:
num_stages = len(s)
if num_stages != 0:
found = 0
for i in s:
if i in valid_stages:
if min_stage <= i <= max_stage:
found += 1
if found == num_stages:
builder.append(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment