mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Add readLimitToCapacity(); to optimise this use case
This commit is contained in:
@@ -659,7 +659,7 @@ public abstract class SegmentStages implements SegmentLock, LocksInterface {
|
||||
|
||||
@Stage("Segment")
|
||||
public Bytes segmentBytesForRead() {
|
||||
segmentBytes.readLimit(segmentBytes.capacity());
|
||||
segmentBytes.readLimitToCapacity();
|
||||
return segmentBytes;
|
||||
}
|
||||
|
||||
|
||||
@@ -702,7 +702,7 @@ public class VanillaChronicleMap<K, V, R>
|
||||
}
|
||||
|
||||
long keySizeOffset = entrySpaceOffset + (entryPos * chunkSize);
|
||||
bs.readLimit(bs.capacity());
|
||||
bs.readLimitToCapacity();
|
||||
bs.readPosition(keySizeOffset);
|
||||
long keySize = keySizeMarshaller.readSize(bs);
|
||||
long keyOffset = bs.readPosition();
|
||||
|
||||
Reference in New Issue
Block a user