perf(addon-search): cache lowercased line text in line cache

Lazily store a lowercased line variant in the line cache entry to avoid
repeated toLowerCase calls during case-insensitive searches.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Daniel Imms
2026-05-25 17:41:58 -07:00
co-authored by Cursor
parent a7467a901d
commit e4ebd082ce
2 changed files with 16 additions and 2 deletions
+5 -1
View File
@@ -15,7 +15,11 @@ export type LineCacheEntry = [
/**
* The offsets where each line starts when the entry describes a wrapped line.
*/
lineOffsets: number[]
lineOffsets: number[],
/**
* Lowercased line text for case-insensitive searches, lazily populated.
*/
lineAsLower?: string
];
/**