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(); }