mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-27 19:22:15 -05:00
simplified getUsers(max) code
This commit is contained in:
parent
1153e6120d
commit
0af8ee341c
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user