diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-07-03 22:09:29 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2019-07-03 23:08:14 +0200 |
commit | 880b0b534cf5780dfe236def0847ded88da84019 (patch) | |
tree | 752286aa66025f730def200841deefe43d976550 /javaunohelper | |
parent | 04fbd174cb787ea15fb74abeca37589ab74df6ab (diff) |
cid#1448214: perf inefficient map iterator
Change-Id: Ia145b46400acf2b7a35bedf689fc7fe74758a2f3
Reviewed-on: https://gerrit.libreoffice.org/75060
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'javaunohelper')
-rw-r--r-- | javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java index a255721046e5..803c02e8340c 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java @@ -41,15 +41,14 @@ public class MultiTypeInterfaceContainer if ( (size=map.size()) > 0) { Type [] arTypes= new Type[size]; - Iterator<Object> it= map.keySet().iterator(); int countTypes= 0; - while (it.hasNext()) + for (Map.Entry<Object,InterfaceContainer> entry : map.entrySet()) { - Object key= it.next(); - InterfaceContainer cont= map.get(key); + InterfaceContainer cont= entry.getValue(); if (cont != null && cont.size() > 0) { + Object key = entry.getKey(); if (key == null) arTypes[countTypes++]= new Type(); else if (key instanceof Type) |