pre-compute firstByteMaxValue
this operation is executed very often during ingestion
This commit is contained in:
@@ -28,9 +28,11 @@ enum ByteType {
|
||||
}
|
||||
|
||||
private final int firstBytePrefix;
|
||||
private final int firstByteMaxValue;
|
||||
|
||||
private ByteType(final int firstBytePrefix) {
|
||||
this.firstBytePrefix = firstBytePrefix;
|
||||
firstByteMaxValue = firstBytePrefix-1;
|
||||
}
|
||||
|
||||
public int getBytePrefix() {
|
||||
@@ -48,7 +50,7 @@ enum ByteType {
|
||||
* @return the maximum value for the first byte of this sequence
|
||||
*/
|
||||
public long getFirstByteMaxValue() {
|
||||
return firstBytePrefix - 1;
|
||||
return firstByteMaxValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user