From a8bea13559dd52cdd9fc2a2a034029dc5a812883 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Sat, 7 Oct 2006 09:00:05 +0000 Subject: [PATCH] small optimization of getMetacontactAt --- .../impl/contactlist/MetaContactGroupImpl.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java index c17ec9b8c..65dbbda0f 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java @@ -505,20 +505,7 @@ public MetaContactGroupImpl findMetaContactGroupByContactGroup( public MetaContact getMetaContact(int index) throws IndexOutOfBoundsException { - int i = 0; - - Iterator childrenIter = getChildContacts(); - - while (childrenIter.hasNext()) - { - MetaContact result = (MetaContact) childrenIter.next(); - if (i++ == index) - return result; - } - //if we got here then index was out of the bounds - throw new IndexOutOfBoundsException(i - + " is larger than size()=" - + childContacts.size()); + return (MetaContactImpl)this.childContactsOrderedCopy.get(index); } /**