Commit 693673b
committed
perf(linter): reduce iterations when collecting directories for nested configs (#12329)
Small perf optimization.
Presumably all paths will usually have the same prefix e.g.:
* `/Users/bozo/projects/best-project-ever`
* `/Users/bozo/projects/best-project-ever/src/components`
* `/Users/bozo/projects/best-project-ever/src/server`
When finding directories to search for nested configs, stop walking up to parent directories when find a directory that's already in the `HashSet`. We know that dir's parent, grandparent, etc will already be in the set too, so no need to check them again.1 parent b36dc92 commit 693673b
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
| |||
0 commit comments