mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Fixing squid:S1066- Collapsible "if" statements should be merged.
This commit is contained in:
@@ -182,9 +182,8 @@ public class UpdateLock implements InterProcessLock {
|
||||
return;
|
||||
case UPDATE_LOCKED:
|
||||
entry.closeDelayedUpdateChecksum();
|
||||
if (s.decrementUpdate() == 0) {
|
||||
if (s.writeZero())
|
||||
s.segmentHeader.downgradeUpdateToReadLock(s.segmentHeaderAddress);
|
||||
if (s.decrementUpdate() == 0 && s.writeZero()) {
|
||||
s.segmentHeader.downgradeUpdateToReadLock(s.segmentHeaderAddress);
|
||||
}
|
||||
break;
|
||||
case WRITE_LOCKED:
|
||||
|
||||
@@ -71,11 +71,9 @@ public abstract class HashQuery<K> implements SetEntry<K> {
|
||||
if (s.nestedContextsLockedOnSameSegment &&
|
||||
s.rootContextLockedOnThisSegment.latestSameThreadSegmentModCount() !=
|
||||
s.contextModCount) {
|
||||
if (ks.keySearchInit()) {
|
||||
if (ks.searchState == PRESENT) {
|
||||
if (!hashLookupSearch.checkSlotContainsExpectedKeyAndValue(entry.pos))
|
||||
hlp.closeHashLookupPos();
|
||||
}
|
||||
if (ks.keySearchInit() && ks.searchState == PRESENT &&
|
||||
!hashLookupSearch.checkSlotContainsExpectedKeyAndValue(entry.pos)) {
|
||||
hlp.closeHashLookupPos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,10 +215,9 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
boolean tierHasChanged = allocatedChunks.initEntryAndKeyCopying(
|
||||
entrySize, valueSizeOffset - keySizeOffset, pos, entrySizeInChunks);
|
||||
|
||||
if (tierHasChanged) {
|
||||
// implicitly inits key search, locating hashLookupPos on the empty slot
|
||||
if (!ks.searchStateAbsent())
|
||||
throw new AssertionError();
|
||||
// implicitly inits key search, locating hashLookupPos on the empty slot
|
||||
if (tierHasChanged && !ks.searchStateAbsent()) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
initValue(newValue);
|
||||
|
||||
Reference in New Issue
Block a user