aboutsummaryrefslogtreecommitdiff
path: root/juick-core
diff options
context:
space:
mode:
Diffstat (limited to 'juick-core')
-rw-r--r--juick-core/src/main/java/com/juick/server/UserQueries.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/juick-core/src/main/java/com/juick/server/UserQueries.java b/juick-core/src/main/java/com/juick/server/UserQueries.java
index eb2918c0..1ba0f83b 100644
--- a/juick-core/src/main/java/com/juick/server/UserQueries.java
+++ b/juick-core/src/main/java/com/juick/server/UserQueries.java
@@ -30,6 +30,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
+import java.util.stream.Collectors;
/**
*
@@ -133,16 +134,7 @@ public class UserQueries {
}
public static boolean fillUsersByID(JdbcTemplate sql, List<User> users) {
- boolean ret = false;
-
- String uids = "";
- final int usersSize = users.size();
- for (int i = 0; i < usersSize; i++) {
- if (i > 0) {
- uids += ",";
- }
- uids += users.get(i).getUID();
- }
+ String uids = StringUtils.arrayToCommaDelimitedString(users.stream().map(u -> u.getUID()).collect(Collectors.toList()).toArray());
sql.query("SELECT id,nick,banned FROM users WHERE id IN (" + uids + ")",
(rs, num) -> {