Commit 0bf499a
committed
limit recursion for **, improve perf considerably
This limits the levels of recursion allowed when encountering multiple
non-adjacent `**` portions of a pattern.
Update `**` handling, with performance massively improved by limiting
the recursive walk much more aggressively. When a `**` portion is
present, the entire pattern is split up into sections. The head and tail
first have to match, and then each subsequent portion is only tested in
the part of the file where it might actually be found, taking advantage
of the fact that non-globstar portions must always consume as many path
portions as there are pattern portions.
Fix: GHSA-7r86-cg39-jmmj1 parent 9f15c58 commit 0bf499a
File tree
7 files changed
+350
-105
lines changed- src
- test
7 files changed
+350
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
399 | 415 | | |
400 | 416 | | |
401 | 417 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments