From 43d7e5b726ba6ac22c62e9c245dc1fc2c25e0843 Mon Sep 17 00:00:00 2001 From: "Ray J. Greenwell" Date: Thu, 20 Mar 2014 14:16:00 -0700 Subject: [PATCH] Drive-by: use one Entry for all logs. --- .../java/com/threerings/crowd/chat/server/ChatHistory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java b/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java index 258e126ce..f1743896b 100644 --- a/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java +++ b/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java @@ -143,13 +143,14 @@ public class ChatHistory msg.timestamp = System.currentTimeMillis(); } + Entry entry = new Entry(channel, msg); for (Name username : usernames) { // add the message to this user's chat history List history = getList(username); if (history == null) { continue; } - history.add(new Entry(channel, msg)); + history.add(entry); // if the history is big enough, potentially prune it (we always prune when asked for // the history, so this is just to balance memory usage with CPU expense)