Code cleanup

This commit is contained in:
Andrea Cavalli 2022-05-22 00:56:32 +02:00
parent bff4d87164
commit fe31f9b1c7
2 changed files with 6 additions and 4 deletions

View File

@ -484,10 +484,11 @@ public class DatabaseMapDictionary<T, U> extends DatabaseMapDictionaryDeep<T, U,
if (keyMin == null && keyMax == null) {
return getAllStages(snapshot, smallRange);
} else {
Mono<LLRange> boundedRangeMono = Mono.usingWhen(rangeMono,
range -> Mono.fromCallable(() -> getPatchedRange(range, keyMin, keyMax)),
range -> Mono.fromRunnable(range::close)
);
Mono<LLRange> boundedRangeMono = rangeMono.map(range -> {
try (range) {
return getPatchedRange(range, keyMin, keyMax);
}
});
return getAllStages(snapshot, boundedRangeMono, reverse, smallRange);
}
}

View File

@ -128,6 +128,7 @@ public final class OptimisticRocksDBColumn extends AbstractRocksDBColumn<Optimis
prevDataToSendToUpdater = null;
}
try {
assert newData == null || !newData.isAccessible();
newData = updater.apply(prevDataToSendToUpdater);
} finally {
if (prevDataToSendToUpdater != null && prevDataToSendToUpdater.isAccessible()) {