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;
|
INPUT_TYPE inputType;
|
||||||
final byte t = metaIn.readByte();
|
final byte t = metaIn.readByte();
|
||||||
switch (t) {
|
inputType =
|
||||||
case 0:
|
switch (t) {
|
||||||
inputType = INPUT_TYPE.BYTE1;
|
case 0 -> INPUT_TYPE.BYTE1;
|
||||||
break;
|
case 1 -> INPUT_TYPE.BYTE2;
|
||||||
case 1:
|
case 2 -> INPUT_TYPE.BYTE4;
|
||||||
inputType = INPUT_TYPE.BYTE2;
|
default -> throw new CorruptIndexException("invalid input type " + t, metaIn);
|
||||||
break;
|
};
|
||||||
case 2:
|
|
||||||
inputType = INPUT_TYPE.BYTE4;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new CorruptIndexException("invalid input type " + t, metaIn);
|
|
||||||
}
|
|
||||||
long startNode = metaIn.readVLong();
|
long startNode = metaIn.readVLong();
|
||||||
long numBytes = metaIn.readVLong();
|
long numBytes = metaIn.readVLong();
|
||||||
return new FSTMetadata<>(inputType, outputs, emptyOutput, startNode, version, numBytes);
|
return new FSTMetadata<>(inputType, outputs, emptyOutput, startNode, version, numBytes);
|
||||||
|
|
Loading…
Reference in New Issue