Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codeflash/languages/java/instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def _collect_calls(node, wrapper_bytes, body_bytes, prefix_len, func_name, analy
def _byte_to_line_index(byte_offset: int, line_byte_starts: list[int]) -> int:
"""Map a byte offset in body_text to a body_lines index."""
idx = bisect.bisect_right(line_byte_starts, byte_offset) - 1
return max(0, idx)
return max(idx, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The optimization in this PR (0 if idx < 0 else idx instead of max(0, idx)) was reverted by prek's FURB136 lint rule back to max(idx, 0). This effectively nullifies the performance improvement this PR intended to provide, since max(idx, 0) is functionally equivalent to the original max(0, idx).

This PR no longer provides any meaningful optimization after the lint auto-fix.



def _infer_array_cast_type(line: str) -> str | None:
Expand Down
Loading