diff options
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/MucOptions.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 4fe26743..db27810f 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -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() { |