Skip to content

Commit bcc19f7

Browse files
handle repaired code is exact same as the original code
1 parent b93fd34 commit bcc19f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ def get_results_not_matched_error(self) -> Failure:
18061806
console.rule()
18071807
return Failure("Test results did not match the test results of the original code.")
18081808

1809-
def run_optimized_candidate(
1809+
def run_optimized_candidate( # noqa: PLR0911
18101810
self,
18111811
*,
18121812
optimization_candidate_index: int,
@@ -1924,6 +1924,9 @@ def run_optimized_candidate(
19241924
candidate=new_candidate,
19251925
exp_type=exp_type,
19261926
)
1927+
msg = "No functions were replaced in the optimized code. Skipping optimization candidate."
1928+
logger.warning(f"force_lsp|{msg}")
1929+
return Failure(msg), candidate
19271930
except (ValueError, SyntaxError, cst.ParserSyntaxError, AttributeError) as e:
19281931
logger.error(e)
19291932
self.write_code_and_helpers(

0 commit comments

Comments
 (0)