Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Fix codeclimate
Browse files Browse the repository at this point in the history
  • Loading branch information
persehoney committed Dec 6, 2023
1 parent 05016dd commit 96fff3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/ru/vk/itmo/solnyshkoksenia/DaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ private void autoFlush() throws IOException {
}

private void tryFlush() {
State curState = this.curState.checkAndGet();
State state = this.curState.checkAndGet();
try {
curState.flush();
state.flush();
} catch (IOException e) {
throw new DaoException("Flush failed", e);
}

lock.writeLock().lock();
try {
this.curState = new State(curState.config, curState.storage, new ConcurrentSkipListMap<>(comparator),
this.curState = new State(state.config, state.storage, new ConcurrentSkipListMap<>(comparator),
new DiskStorage(DiskStorage.loadOrRecover(path, arena), path));
} catch (IOException e) {
throw new DaoException("Cannot recover storage on disk", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public Iterator<Triple<MemorySegment>> range(
@Override
protected boolean skip(Triple<MemorySegment> memorySegmentEntry) {
if (memorySegmentEntry.expiration() != null) {
return memorySegmentEntry.value() == null ||
memorySegmentEntry.expiration().toArray(ValueLayout.JAVA_LONG_UNALIGNED)[0]
return memorySegmentEntry.value() == null
|| memorySegmentEntry.expiration().toArray(ValueLayout.JAVA_LONG_UNALIGNED)[0]
<= System.currentTimeMillis();
}
return memorySegmentEntry.value() == null;
Expand Down

0 comments on commit 96fff3a

Please sign in to comment.