From 2c8032aa075e9aaa73746429b05546a48c7e007e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 22 Feb 2023 02:14:18 +0300 Subject: Fix memory issues when using Reaction --- src/main/java/com/juick/service/MessagesServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java/com/juick/service/MessagesServiceImpl.java') diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index b0e365f8..083524b1 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -845,8 +845,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ Reaction reaction = new Reaction(likeId); reaction.setCount(count); reaction.setDescription(description); - results.computeIfAbsent(messageId, HashSet::new); - results.get(messageId).add(reaction); + results.computeIfAbsent(messageId, HashSet::new).add(reaction); } return results; }); -- cgit v1.2.3