Prefer using Collections.emptyList() rather than new ArrayList

This commit is contained in:
Daniil Z committed 2021-03-01 19:49:54 +03:00
1 parent 15c2e2fa9a
commit afafcee2bb
6 files changed
+14 -13

No files matched your search

@@ -218,7 +218,7 @@ public class EdithomeCommand extends CommandBase implements TabCompleter {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
Player p = (Player) sender;
if (!p.hasPermission("huskhomes.edithome")) {
return new ArrayList<>();
return Collections.emptyList();
}
if (args.length == 1) {
final List<String> tabCompletions = new ArrayList<>();
@@ -236,7 +236,7 @@ public class EdithomeCommand extends CommandBase implements TabCompleter {
}
return editHomeOptions;
} else {
return new ArrayList<>();
return Collections.emptyList();
}
}
}