From 604c5f9e7163d05c939de844920a52df91fc4b4c Mon Sep 17 00:00:00 2001 From: leventov Date: Wed, 26 Aug 2015 22:56:44 +0300 Subject: [PATCH] Rollback 9f9aaa9b9e13a127885dcc27c992924897b1e1e7 --- .../chronicle/map/ReplicatedChronicleMap.java | 2 +- .../chronicle/map/VanillaChronicleMap.java | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java index a47c018ef..839eb6ed0 100644 --- a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java @@ -1212,7 +1212,7 @@ final class ReplicatedChronicleMap toKey, - GetValueInterops getValueInterops, VB value, V oldValue, + GetValueInterops getValueInterops, VB value, InstanceOrBytesToInstance toValue, long hash2, boolean replaceIfPresent, ReadValue readValue, boolean resultUnused) { return putWithoutLock(copies, segmentState, metaKeyInterop, keyInterop, key, keySize, diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 3cd6572c4..bd9ceafd4 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -2266,20 +2266,11 @@ class VanillaChronicleMap, copies = SegmentState.getCopies(copies); segmentState = SegmentState.get(copies); } - // TODO optimise - V oldValue = null; - if (eventListener != null) - try { - oldValue = lookupUsing((K) key, null, false); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - writeLock(); try { return putWithoutLock(copies, segmentState, metaKeyInterop, keyInterop, key, keySize, toKey, - getValueInterops, value, oldValue, toValue, + getValueInterops, value, toValue, hash2, replaceIfPresent, readValue, resultUnused); } finally { segmentState.close(); @@ -2293,7 +2284,7 @@ class VanillaChronicleMap, @NotNull ThreadLocalCopies copies, @NotNull SegmentState segmentState, MKBI metaKeyInterop, KBI keyInterop, KB key, long keySize, InstanceOrBytesToInstance toKey, - GetValueInterops getValueInterops, VB value, V oldValue, + GetValueInterops getValueInterops, VB value, InstanceOrBytesToInstance toValue, long hash2, boolean replaceIfPresent, ReadValue readValue, boolean resultUnused) { @@ -2335,7 +2326,7 @@ class VanillaChronicleMap, segmentState.valueSizePos, true, false); if (eventListener != null) eventListener.onPut(toKey.toInstance(copies, key, keySize), - toValue.toInstance(copies, value, valueSize), oldValue, false, true); + toValue.toInstance(copies, value, valueSize), null, false, true); return resultUnused ? null : readValue.readNull(); }