Commit 240b67c
Add caching to avoid duplicate isPathIgnored() calls
Introduced an ignored_cache array in Distignore_Filter_Iterator to cache the results of isPathIgnored() checks. This eliminates duplicate checks:
- Once in hasChildren() when deciding whether to descend into directories
- Once in get_file_list() when categorizing files/directories
The cache is shared between both methods via the new isPathIgnoredCached() method, reducing redundant gitignore pattern matching for directories.
Co-authored-by: swissspidy <[email protected]>1 parent e1f9c5c commit 240b67c
2 files changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
50 | 71 | | |
51 | 72 | | |
52 | 73 | | |
| |||
81 | 102 | | |
82 | 103 | | |
83 | 104 | | |
84 | | - | |
| 105 | + | |
85 | 106 | | |
86 | 107 | | |
87 | 108 | | |
| |||
100 | 121 | | |
101 | 122 | | |
102 | 123 | | |
103 | | - | |
| 124 | + | |
104 | 125 | | |
105 | 126 | | |
106 | 127 | | |
| |||
0 commit comments