|
24 | 24 | import java.util.HashMap; |
25 | 25 | import java.util.HashSet; |
26 | 26 | import java.util.List; |
| 27 | +import java.util.Map; |
27 | 28 | import java.util.Map.Entry; |
28 | 29 | import java.util.Set; |
29 | | -import java.util.SortedMap; |
30 | | -import java.util.TreeMap; |
31 | 30 | import java.util.concurrent.ConcurrentHashMap; |
32 | 31 | import java.util.function.Consumer; |
33 | 32 | import org.eclipse.core.filesystem.EFS; |
@@ -134,7 +133,7 @@ class LocationMap { |
134 | 133 | /** |
135 | 134 | * Map of FileStore->IResource OR FileStore->ArrayList of (IResource) |
136 | 135 | */ |
137 | | - private final SortedMap<IFileStore, Object> map = new TreeMap<>(IFileStore::compareTo); |
| 136 | + private final Map<IFileStore, Object> map = new HashMap<>(10_000); |
138 | 137 |
|
139 | 138 | /** |
140 | 139 | * Adds the given resource to the map, keyed by the given location. |
@@ -177,16 +176,7 @@ public void clear() { |
177 | 176 | * given location as a prefix. |
178 | 177 | */ |
179 | 178 | public void matchingPrefixDo(IFileStore prefix, Consumer<IResource> doit) { |
180 | | - SortedMap<IFileStore, Object> matching; |
181 | | - IFileStore prefixParent = prefix.getParent(); |
182 | | - if (prefixParent != null) { |
183 | | - //endPoint is the smallest possible path greater than the prefix that doesn't |
184 | | - //match the prefix |
185 | | - IFileStore endPoint = prefixParent.getChild(prefix.getName() + "\0"); //$NON-NLS-1$ |
186 | | - matching = map.subMap(prefix, endPoint); |
187 | | - } else { |
188 | | - matching = map; |
189 | | - } |
| 179 | + Map<IFileStore, Object> matching = map; |
190 | 180 | for (Object value : matching.values()) { |
191 | 181 | if (value == null) { |
192 | 182 | return; |
|
0 commit comments