Commit 20f5a4b
committed
Remove redundant trim/toLowerCase in scoreQueryMatch
All callers already pass pre-normalized (trimmed and lowercased) inputs,
so the internal .trim().toLowerCase() calls were redundant O(n) string
operations allocating unnecessary copies on every candidate per keystroke.
Replace with a destructured read and a JSDoc contract stating that inputs
must be pre-normalized.1 parent b0488e2 commit 20f5a4b
File tree
1 file changed
+7
-2
lines changed1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
90 | | - | |
91 | | - | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
0 commit comments