mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-15 01:08:35 +00:00
Upstream merges and a few code cleanups
This commit is contained in:
@ -71,12 +71,7 @@ public class MainUtil {
|
||||
if (suggestions.getClass() != ArrayList.class) {
|
||||
suggestions = new ArrayList<>(suggestions);
|
||||
}
|
||||
Iterator<String> iter = suggestions.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (!iter.next().startsWith(prefix)) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
suggestions.removeIf(s -> !s.startsWith(prefix));
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
@ -917,11 +912,11 @@ public class MainUtil {
|
||||
if (directory.exists()) {
|
||||
File[] files = directory.listFiles();
|
||||
if (null != files) {
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
if (files[i].isDirectory()) {
|
||||
iterateFiles(files[i], task);
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
iterateFiles(file, task);
|
||||
} else {
|
||||
task.accept(files[i]);
|
||||
task.accept(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user