diff options
author | lookshe <github@lookshe.org> | 2016-03-20 02:29:46 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-03-20 02:29:46 +0100 |
commit | ad8e8344c0c051dd22adf76df624dd16cabcea28 (patch) | |
tree | a8e5818ef393087eb406df9d26bef3b36caa3f75 /src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java | |
parent | 6de11f38eaeb758692e0690f7150556d46d1f674 (diff) | |
parent | fb00372269ab0ed9ed0fbc1bd502695ffc17dd1b (diff) |
Merge branch 'trz/rebase' (early part) into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/entities/MucOptions.java | 13 |
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() { |