Commit 82d784f
authored
perf(lexer): reduce bounds checks in
`Lexer::get_string` was slicing source text twice - once to obtain `raw`
and then again to trim off a byte from start/end in the case of strings.
Instead, slice only once. This removes 2 bounds checks and 2 x UTF-8
character boundary checks for strings.Lexer::get_string (#16317)1 parent cc2f352 commit 82d784f
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
262 | 266 | | |
263 | 267 | | |
264 | | - | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | | - | |
| 271 | + | |
267 | 272 | | |
| 273 | + | |
268 | 274 | | |
269 | 275 | | |
0 commit comments