diff --git a/codeflash/languages/java/instrumentation.py b/codeflash/languages/java/instrumentation.py index 6f2725b9b..4a87aad93 100644 --- a/codeflash/languages/java/instrumentation.py +++ b/codeflash/languages/java/instrumentation.py @@ -14,9 +14,9 @@ from __future__ import annotations -import bisect import logging import re +from bisect import bisect_right as _bisect_right from typing import TYPE_CHECKING if TYPE_CHECKING: @@ -235,7 +235,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 + idx = _bisect_right(line_byte_starts, byte_offset) - 1 return max(0, idx)