mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
optimizations: do not create unneeded intermediary sets, avoid unnecessary conversions, do not create substrings
GitOrigin-RevId: 201ade375e9feecfd5c2f0b7cf581b2922e61355
This commit is contained in:
committed by
intellij-monorepo-bot
parent
738eb88eb8
commit
0a4b728177
@@ -217,12 +217,13 @@ public final class FilenameIndex {
|
||||
int len = ext.length() + 1;
|
||||
|
||||
Set<String> names = new HashSet<>();
|
||||
for (String name : getAllFilenames(project)) {
|
||||
processAllFileNames(name ->{
|
||||
int length = name.length();
|
||||
if (length > len && name.substring(length - len).equalsIgnoreCase(dotExt)) {
|
||||
if (length > len && name.regionMatches(true, length - len, dotExt, 0, len)) {
|
||||
names.add(name);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}, GlobalSearchScope.allScope(project), null);
|
||||
return getVirtualFilesByNames(names, searchScope, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user