mirror of https://github.com/apache/lucene.git
Modernize switch statements in FST (#13756)
This commit is contained in:
parent
ccccf92abd
commit
029c3b5e13
|
@ -481,19 +481,13 @@ public final class FST<T> implements Accountable {
|
|||
}
|
||||
INPUT_TYPE inputType;
|
||||
final byte t = metaIn.readByte();
|
||||
inputType =
|
||||
switch (t) {
|
||||
case 0:
|
||||
inputType = INPUT_TYPE.BYTE1;
|
||||
break;
|
||||
case 1:
|
||||
inputType = INPUT_TYPE.BYTE2;
|
||||
break;
|
||||
case 2:
|
||||
inputType = INPUT_TYPE.BYTE4;
|
||||
break;
|
||||
default:
|
||||
throw new CorruptIndexException("invalid input type " + t, metaIn);
|
||||
}
|
||||
case 0 -> INPUT_TYPE.BYTE1;
|
||||
case 1 -> INPUT_TYPE.BYTE2;
|
||||
case 2 -> INPUT_TYPE.BYTE4;
|
||||
default -> throw new CorruptIndexException("invalid input type " + t, metaIn);
|
||||
};
|
||||
long startNode = metaIn.readVLong();
|
||||
long numBytes = metaIn.readVLong();
|
||||
return new FSTMetadata<>(inputType, outputs, emptyOutput, startNode, version, numBytes);
|
||||
|
|
Loading…
Reference in New Issue