Skip to content

Commit a831ee3

Browse files
committed
fix a bug
Signed-off-by: Saurabh Misra <[email protected]>
1 parent 95a38d3 commit a831ee3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

codeflash/models/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def unique_invocation_loop_id(self) -> str:
558558
return f"{self.loop_index}:{self.id.id()}"
559559

560560

561-
class TestResults(BaseModel): # noqa: PLW1641
561+
class TestResults(BaseModel):
562562
# don't modify these directly, use the add method
563563
# also we don't support deletion of test results elements - caution is advised
564564
test_results: list[FunctionTestInvocation] = []

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def determine_best_candidate(
670670
diff_strs = []
671671
runtimes_list = []
672672
for valid_opt in valid_optimizations:
673-
valid_opt_normalized_code = ast.unparse(ast.parse(valid_opt.candidate.source_code.flat.strip()))
673+
valid_opt_normalized_code = normalize_code(valid_opt.candidate.source_code.flat.strip())
674674
new_candidate_with_shorter_code = OptimizedCandidate(
675675
source_code=ast_code_to_id[valid_opt_normalized_code]["shorter_source_code"],
676676
optimization_id=valid_opt.candidate.optimization_id,

0 commit comments

Comments
 (0)