aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-31 00:15:14 +0300
committerGravatar Vitaly Takmazov2016-07-31 00:15:14 +0300
commitd6616e91ea2f51a909f5f259e364748f7aa7fcc1 (patch)
tree5ff993860946180de1c534fec85d85661064f345 /juick-www/src
parenta060c505982ceea5142f78357d42ba2f0de19b60 (diff)
www: sort tags descending
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/java/com/juick/www/User.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/juick-www/src/main/java/com/juick/www/User.java b/juick-www/src/main/java/com/juick/www/User.java
index 3417a3cd..29218d0a 100644
--- a/juick-www/src/main/java/com/juick/www/User.java
+++ b/juick-www/src/main/java/com/juick/www/User.java
@@ -323,7 +323,7 @@ public class User {
public static String pageUserTags(JdbcTemplate sql, com.juick.User user, com.juick.User visitor, int cnt) {
List<Tag> tags = TagQueries.getUserTagsAll(sql, user.getUID()).stream()
- .sorted((e1, e2) -> Integer.compare(e1.UsageCnt, e2.UsageCnt)).collect(Collectors.toList());
+ .sorted((e1, e2) -> Integer.compare(e2.UsageCnt, e1.UsageCnt)).collect(Collectors.toList());
int maxUsageCnt = tags.stream().map(t -> t.UsageCnt).max(Integer::max).orElse(0);
String ret = "";
int count = cnt > 0 ? Math.min(tags.size(), cnt) : tags.size();