Skip to content

Commit a10600c

Browse files
committed
Fixed changes to the FunctionOptimizer
1 parent 3cbd6b7 commit a10600c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import ast
44
import concurrent.futures
5+
import dataclasses
56
import os
67
import shutil
78
import subprocess
@@ -453,7 +454,7 @@ def determine_best_candidate(
453454
if temp_code_file_path and temp_code_file_path.exists():
454455
temp_code_file_path.unlink(missing_ok=True)
455456

456-
candidate.source_code = formatted_candidate_code
457+
candidate = dataclasses.replace(candidate, source_code=formatted_candidate_code)
457458

458459
get_run_tmp_file(Path(f"test_return_values_{candidate_index}.bin")).unlink(missing_ok=True)
459460
get_run_tmp_file(Path(f"test_return_values_{candidate_index}.sqlite")).unlink(missing_ok=True)

0 commit comments

Comments
 (0)