Skip to content

Commit 5aab3b8

Browse files
committed
bugfix
1 parent 19cd5c8 commit 5aab3b8

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
@@ -556,13 +556,15 @@ def determine_best_candidate(
556556
ai_service_client=ai_service_client,
557557
executor=executor,
558558
)
559+
# filter out empty strings of code
559560
more_opt_candidates = [
560561
OptimizedCandidate(
561562
source_code=refinement_diffs[i],
562563
explanation=self.valid_optimizations[i].candidate.explanation,
563564
optimization_id=self.valid_optimizations[i].candidate.optimization_id,
564565
)
565566
for i in range(len(refinement_diffs))
567+
if refinement_diffs[i] != ""
566568
]
567569
# we no longer need to apply diffs since we are generating the entire code again
568570
candidates.extend(more_opt_candidates)

0 commit comments

Comments
 (0)