Clean up the getJailsByPrefix method
This commit is contained in:
parent
fd2e69cb77
commit
1c43951a7c
@ -98,13 +98,9 @@ public class JailManager {
|
|||||||
public List<String> getJailsByPrefix(String prefix) {
|
public List<String> getJailsByPrefix(String prefix) {
|
||||||
List<String> results = new ArrayList<String>();
|
List<String> results = new ArrayList<String>();
|
||||||
|
|
||||||
for(Jail j : this.jails.values()) {
|
for(Jail j : this.jails.values())
|
||||||
if(!prefix.isEmpty() && StringUtil.startsWithIgnoreCase(j.getName(), prefix)) {
|
if(prefix.isEmpty() || StringUtil.startsWithIgnoreCase(j.getName(), prefix))
|
||||||
results.add(j.getName());
|
results.add(j.getName());
|
||||||
}else {
|
|
||||||
results.add(j.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(results);
|
Collections.sort(results);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user