Skip to content

Commit 766c319

Browse files
committed
trying
1 parent 78e2d65 commit 766c319

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def determine_best_candidate(
393393
try:
394394
candidate_index = 0
395395
original_len = len(candidates)
396-
while candidates:
396+
while True:
397397
done = True if future_line_profile_results is None else future_line_profile_results.done()
398398
if done and (future_line_profile_results is not None):
399399
line_profile_results = future_line_profile_results.result()
@@ -512,7 +512,8 @@ def determine_best_candidate(
512512
self.write_code_and_helpers(
513513
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path
514514
)
515-
515+
if done and not candidates:
516+
break
516517
except KeyboardInterrupt as e:
517518
self.write_code_and_helpers(
518519
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path

0 commit comments

Comments
 (0)