[Libreoffice-commits] core.git: javaunohelper/com
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 3 21:19:11 UTC 2019
javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
New commits:
commit 4ded63a1aaf3a8ca7916e822a8e7eb342d21929d
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Jul 3 22:13:59 2019 +0200
Commit: Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Jul 3 23:18:05 2019 +0200
cid#1448341: perf inefficient map iterator
Change-Id: I5b5ba2b6ed370765e38b51a23175c73dc0e2c8f8
Reviewed-on: https://gerrit.libreoffice.org/75061
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
index 803c02e8340c..9b061f81c217 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
@@ -80,10 +80,9 @@ public class MultiTypeInterfaceContainer
synchronized public InterfaceContainer getContainer(Object key)
{
InterfaceContainer retVal= null;
- Iterator<Object> it= map.keySet().iterator();
- while (it.hasNext())
+ for (Map.Entry<Object,InterfaceContainer> entry : map.entrySet())
{
- Object obj= it.next();
+ Object obj= entry.getKey();
if (obj == null && key == null)
{
retVal= map.get(null);
@@ -91,7 +90,7 @@ public class MultiTypeInterfaceContainer
}
else if( obj != null && obj.equals(key))
{
- retVal= map.get(obj);
+ retVal= entry.getValue();
break;
}
}
More information about the Libreoffice-commits
mailing list