mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Fixed several bugs in contexts API implementation and in VanillaChronicleMap.putValue()
This commit is contained in:
@@ -238,15 +238,18 @@ class Int24Int24MultiMap implements MultiMap {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replacePrevPos(SearchState searchState, long newValue) {
|
||||
public void replacePrevPos(SearchState searchState, long newValue,
|
||||
boolean oldValueInPositions) {
|
||||
checkValueForPut(newValue);
|
||||
long prevPos = searchState.searchPos;
|
||||
if (!searchState.putAfterFailedSearch)
|
||||
prevPos = stepBack(prevPos);
|
||||
long oldEntry = bytes.readInt48(prevPos);
|
||||
long oldValue = value(oldEntry);
|
||||
checkValueForRemove(oldValue);
|
||||
positions.clear(oldValue);
|
||||
if (oldValueInPositions) {
|
||||
long oldEntry = bytes.readInt48(prevPos);
|
||||
long oldValue = value(oldEntry);
|
||||
checkValueForRemove(oldValue);
|
||||
positions.clear(oldValue);
|
||||
}
|
||||
positions.set(newValue);
|
||||
bytes.writeInt48(prevPos, entry(searchState.searchHash, newValue));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user