mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Make replace() returns on absent entry consistent
This commit is contained in:
@@ -1435,7 +1435,7 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
|
||||
return result;
|
||||
}
|
||||
// key is not found
|
||||
return readValue.readNull();
|
||||
return expectedValue == null ? readValue.readNull() : Boolean.FALSE;
|
||||
} finally {
|
||||
segmentState.close();
|
||||
writeUnlock();
|
||||
|
||||
@@ -2603,7 +2603,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
readValue, toValue, pos, offset, entry, hashLookup);
|
||||
}
|
||||
// key is not found
|
||||
return expectedValue == null ? null : Boolean.FALSE;
|
||||
return expectedValue == null ? readValue.readNull() : Boolean.FALSE;
|
||||
} finally {
|
||||
segmentState.close();
|
||||
writeUnlock();
|
||||
|
||||
Reference in New Issue
Block a user