simplified getUsers(max) code

This commit is contained in:
Daniel Gultsch 2016-03-13 17:42:17 +01:00
parent 1153e6120d
commit 0af8ee341c

View File

@ -345,17 +345,8 @@ public class MucOptions {
}
public List<User> getUsers(int max) {
ArrayList<User> users = new ArrayList<>();
int i = 1;
for(User user : this.users.values()) {
users.add(user);
if (i >= max) {
break;
} else {
++i;
}
}
return users;
ArrayList<User> users = getUsers();
return users.subList(0, Math.min(max, users.size()));
}
public int getUserCount() {