From 04e496dc983efaac055ccf3212082c3ff903aa64 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Sun, 21 Mar 2010 16:36:44 +0100 Subject: [PATCH] NamesHandler: cache field lookup --- src/org/yaaic/command/handler/NamesHandler.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/yaaic/command/handler/NamesHandler.java b/src/org/yaaic/command/handler/NamesHandler.java index 845e842..6bcffe9 100644 --- a/src/org/yaaic/command/handler/NamesHandler.java +++ b/src/org/yaaic/command/handler/NamesHandler.java @@ -50,10 +50,13 @@ public class NamesHandler extends BaseHandler } StringBuffer userList = new StringBuffer("Users " + conversation.getName() + ":"); - for (User user : service.getConnection(server.getId()).getUsers(conversation.getName())) { + + User[] mUsers = service.getConnection(server.getId()).getUsers(conversation.getName()); + int mSize = mUsers.length; + for (int i = 0; i < mSize; i++) { userList.append(" "); - userList.append(user.getPrefix()); - userList.append(user.getNick()); + userList.append(mUsers[i].getPrefix()); + userList.append(mUsers[i].getNick()); } Message message = new Message(userList.toString());