mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32: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) {
|
public List<User> getUsers(int max) {
|
||||||
ArrayList<User> users = new ArrayList<>();
|
ArrayList<User> users = getUsers();
|
||||||
int i = 1;
|
return users.subList(0, Math.min(max, users.size()));
|
||||||
for(User user : this.users.values()) {
|
|
||||||
users.add(user);
|
|
||||||
if (i >= max) {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return users;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUserCount() {
|
public int getUserCount() {
|
||||||
|
Loading…
Reference in New Issue
Block a user