Skip to content

Commit 14961b0

Browse files
authored
Merge pull request #1590 from codeflash-ai/codeflash/optimize-pr1199-2026-02-20T07.48.46
⚡️ Speed up function `_infer_array_cast_type` by 81% in PR #1199 (`omni-java`)
2 parents ff8f463 + 732a557 commit 14961b0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

codeflash/languages/java/instrumentation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ def _infer_array_cast_type(line: str) -> str | None:
259259

260260
# Look for primitive array type in the line (usually the first/expected argument)
261261
match = _PRIMITIVE_ARRAY_PATTERN.search(line)
262-
if match:
263-
primitive_type = match.group(1)
264-
return f"{primitive_type}[]"
262+
if not match:
263+
return None
265264

266-
return None
265+
primitive_type = match.group(1)
266+
return f"{primitive_type}[]"
267267

268268

269269
def _get_qualified_name(func: Any) -> str:

0 commit comments

Comments
 (0)