aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/entities')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java b/src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java
index 128e5423..4a330f30 100644
--- a/src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java
+++ b/src/main/java/de/thedevstack/conversationsplus/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() {