We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3bf77b commit 4af0a33Copy full SHA for 4af0a33
1 file changed
codeflash/models/models.py
@@ -553,10 +553,9 @@ def handle_duplicate_candidate(
553
self.optimized_runtimes[candidate.optimization_id] = self.optimized_runtimes.get(past_opt_id)
554
555
# Line profiler results only available for successful runs
556
- if past_opt_id in self.optimized_line_profiler_results:
557
- self.optimized_line_profiler_results[candidate.optimization_id] = self.optimized_line_profiler_results[
558
- past_opt_id
559
- ]
+ line_profiler_result = self.optimized_line_profiler_results.get(past_opt_id)
+ if line_profiler_result is not None:
+ self.optimized_line_profiler_results[candidate.optimization_id] = line_profiler_result
560
561
self.optimizations_post[candidate.optimization_id] = self.ast_code_to_id[normalized_code][
562
"shorter_source_code"
0 commit comments