From 872961446af90ec820c3f736d652583ae59067d5 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sat, 21 Mar 2026 12:46:33 +0000 Subject: [PATCH] perf(linter/plugins): reduce operations in binary search (#20490) Tiny optimization. Use 1 less operation in binary search when converting offset to line-column pair. --- apps/oxlint/src-js/plugins/location.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/oxlint/src-js/plugins/location.ts b/apps/oxlint/src-js/plugins/location.ts index 8ff8969971ebd..4586826f3497b 100644 --- a/apps/oxlint/src-js/plugins/location.ts +++ b/apps/oxlint/src-js/plugins/location.ts @@ -166,7 +166,7 @@ function getLineColumnFromOffsetUnchecked(offset: number): LineColumn { high = lineStartIndices.length, mid: number; do { - mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division + mid = (low + high) >>> 1; if (offset < lineStartIndices[mid]) { high = mid; } else {