Use a switch instead of a cascading if-else.
@@ -402,14 +402,21 @@ private static void populateDynamicTables(final BitInputStream reader, final int
if (symbol < 16) {
value = symbol;
auxBuffer[off++] = value;
- } else if (symbol == 16) {
+ } else
+ switch (symbol) {
+ case 16:
length = (int) (readBits(reader, 2) + 3);
- } else if (symbol == 17) {
+ break;
+ case 17:
value = 0;
length = (int) (readBits(reader, 3) + 3);
- } else if (symbol == 18) {
+ break;
+ case 18:
value = 0;
length = (int) (readBits(reader, 7) + 11);
+ break;
+ default:
+ break;
}
}
}
