Code tidy for Core

This commit is contained in:
Peter Lawrey
2015-06-11 16:02:07 +01:00
parent e6582b0a39
commit 7e1886d82c
@@ -2568,8 +2568,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
throw new NoSuchElementException();
final Segment segment = segments[segIndex];
ThreadLocalCopies copies = SegmentState.getCopies(null);
SegmentState segmentState = SegmentState.get(copies);
try {
try (SegmentState segmentState = SegmentState.get(copies)) {
try {
segment.readLock(null);
} catch (InterruptedException e) {
@@ -2583,7 +2582,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
advance(returnedSeg = segIndex, returnedPos = pos);
return returnedEntry = segment.getEntry(segmentState, pos);
} finally {
segmentState.close();
segment.readUnlock();
}
}