Clean up the getJailsByPrefix method

This commit is contained in:
graywolf336 2015-06-02 12:34:37 -05:00
parent fd2e69cb77
commit 1c43951a7c

View File

@ -98,13 +98,9 @@ public class JailManager {
public List<String> getJailsByPrefix(String prefix) {
List<String> results = new ArrayList<String>();
for(Jail j : this.jails.values()) {
if(!prefix.isEmpty() && StringUtil.startsWithIgnoreCase(j.getName(), prefix)) {
for(Jail j : this.jails.values())
if(prefix.isEmpty() || StringUtil.startsWithIgnoreCase(j.getName(), prefix))
results.add(j.getName());
}else {
results.add(j.getName());
}
}
Collections.sort(results);