Drive-by: use one Entry for all logs.
This commit is contained in:
@@ -143,13 +143,14 @@ public class ChatHistory
|
|||||||
msg.timestamp = System.currentTimeMillis();
|
msg.timestamp = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Entry entry = new Entry(channel, msg);
|
||||||
for (Name username : usernames) {
|
for (Name username : usernames) {
|
||||||
// add the message to this user's chat history
|
// add the message to this user's chat history
|
||||||
List<Entry> history = getList(username);
|
List<Entry> history = getList(username);
|
||||||
if (history == null) {
|
if (history == null) {
|
||||||
continue;
|
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
|
// 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)
|
// the history, so this is just to balance memory usage with CPU expense)
|
||||||
|
|||||||
Reference in New Issue
Block a user