From 0c4becc5d39f2cbee277276910c3575d76ae2dad Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Tue, 18 Dec 2018 15:52:49 +0200 Subject: [PATCH] Remove unnecessary getComparableKey from HashMapBinding This speeds up loading e.g. 60MB mapping file from 32s to 2s gitlab #241 Needed for district. Change-Id: I14a4f6d4998c61f88a7d7798947e70ce041a4f1f (cherry picked from commit e5a79f44f9d6ce5f38fb61c5db0d9af0a1db35a9) --- .../factory/TroveBindingsProvider.java | 2 -- .../binding/impl/HashMapBinding.java | 20 ------------------- 2 files changed, 22 deletions(-) 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()); } } -- 2.47.1