From: jsimomaa Date: Tue, 18 Dec 2018 13:52:49 +0000 (+0200) Subject: Remove unnecessary getComparableKey from HashMapBinding X-Git-Tag: v1.43.0~136^2~210^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F2565%2F2;p=simantics%2Fplatform.git Remove unnecessary getComparableKey from HashMapBinding This speeds up loading e.g. 60MB mapping file from 32s to 2s gitlab #241 Change-Id: I14a4f6d4998c61f88a7d7798947e70ce041a4f1f --- diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TroveBindingsProvider.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TroveBindingsProvider.java index 3eb17213b..e8047450e 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TroveBindingsProvider.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TroveBindingsProvider.java @@ -75,7 +75,6 @@ public class TroveBindingsProvider implements BindingProvider { for (int i=0; i m = ((Map)map); - Binding kb = getKeyBinding(); - for (Object k : m.keySet()) - { - if (kb.equals(k, key)) - return k; - } - return key; - } @SuppressWarnings("unchecked") @Override public void put(Object map, Object key, Object value) { Map m = ((Map)map); - Object ck = getComparableKey(m, key); - m.remove(ck); m.put(key, value); } @@ -254,8 +236,6 @@ public class HashMapBinding extends MapBinding { public void putAll(Object map, Map src) throws BindingException { Map m = ((Map )map); for (Entry e : (Set >) src.entrySet()) { - Object ck = getComparableKey(map, e.getKey()); - m.remove(ck); m.put(e.getKey(), e.getValue()); } }