diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 4fe26743e..db27810fc 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 getUsers(int max) { - ArrayList users = new ArrayList<>(); - int i = 1; - for(User user : this.users.values()) { - users.add(user); - if (i >= max) { - break; - } else { - ++i; - } - } - return users; + ArrayList users = getUsers(); + return users.subList(0, Math.min(max, users.size())); } public int getUserCount() {