Commit c0392a6
committed
perf/search: keep folded mismatch checks constant-time
Most candidate mismatches occur well before the document boundary, where UTF-8's maximum rune width can prove the remaining span fits without decoding it. Reserve the exact rune walk for boundary-adjacent candidates so corruption remains observable without multiplying query-length work across broad candidate sets.
Amp-Thread-ID: https://ampcode.com/threads/T-019fd1ab-1ad4-77f5-9b59-c65232f5b3f11 parent 471350d commit c0392a6
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
| |||
0 commit comments