pre-compute firstByteMaxValue

this operation is executed very often during ingestion
This commit is contained in:
ahr
2018-03-09 08:38:58 +01:00
parent 5a9aae70af
commit 7e5b762c0d

View File

@@ -28,9 +28,11 @@ enum ByteType {
} }
private final int firstBytePrefix; private final int firstBytePrefix;
private final int firstByteMaxValue;
private ByteType(final int firstBytePrefix) { private ByteType(final int firstBytePrefix) {
this.firstBytePrefix = firstBytePrefix; this.firstBytePrefix = firstBytePrefix;
firstByteMaxValue = firstBytePrefix-1;
} }
public int getBytePrefix() { public int getBytePrefix() {
@@ -48,7 +50,7 @@ enum ByteType {
* @return the maximum value for the first byte of this sequence * @return the maximum value for the first byte of this sequence
*/ */
public long getFirstByteMaxValue() { public long getFirstByteMaxValue() {
return firstBytePrefix - 1; return firstByteMaxValue;
} }
/** /**