Skip to content

Commit efa767c

Browse files
committed
fix rare case when line profiler aiservice returns an empty list
1 parent 87822c1 commit efa767c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ def determine_best_candidate(
406406
try:
407407
candidate = candidates.popleft()
408408
except IndexError as e:
409+
if done:
410+
break
409411
continue
410412
candidate_index += 1
411413
get_run_tmp_file(Path(f"test_return_values_{candidate_index}.bin")).unlink(missing_ok=True)

0 commit comments

Comments
 (0)