Repository navigation
Commit 423fd33
authored
ext/standard: Avoid redundant searches in str_replace() (#25851)
Reuse the first match from the counting pass and stop copying
matches at the last known match end. When all matches are
adjacent, advance directly to the next match.1 parent 45a58ad commit 423fd33
2 files changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3337 | 3337 | | |
3338 | 3338 | | |
3339 | 3339 | | |
3340 | | - | |
3341 | | - | |
3342 | | - | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
3343 | 3343 | | |
3344 | | - | |
3345 | | - | |
| 3344 | + | |
| 3345 | + | |
3346 | 3346 | | |
3347 | 3347 | | |
3348 | 3348 | | |
| |||
3359 | 3359 | | |
3360 | 3360 | | |
3361 | 3361 | | |
3362 | | - | |
3363 | | - | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
3364 | 3367 | | |
3365 | 3368 | | |
3366 | | - | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
3367 | 3373 | | |
3368 | 3374 | | |
3369 | 3375 | | |
| |||
0 commit comments