Commit 15ddd84
committed
Result caching: minor optimization tweak [2]
Optimize use of the iterators:
1. Skip dot files at the `RecursiveDirectoryIterator` level by setting the `FilesystemIterator::SKIP_DOTS` flag and remove the code which was doing the same in the callback.
Note: the other two flags are the default flags used by the `RecursiveDirectoryIterator` constructor, so are needed to maintain the existing behaviour.
2. No need for the `$file->getPathname()` function call. The `$key` already contains that information, as per the default flags.
3. No need for a file-system `is_dir()` call. If it's a directory, the iterator will have children.1 parent 5ee7531 commit 15ddd84
1 file changed
+7
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 105 | | |
| 106 | + | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
113 | | - | |
| 111 | + | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
117 | 115 | | |
118 | | - | |
| 116 | + | |
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
| |||
0 commit comments