@@ -103,23 +103,12 @@ void writeDocIds(IntToIntFunction docIds, int count, byte encoding, DataOutput o
103
103
min = Math .min (min , current );
104
104
}
105
105
switch (encoding ) {
106
- case CONTINUOUS_IDS :
107
- writeContinuousIds (docIds , count , out );
108
- break ;
109
- case DELTA_BPV_16 :
110
- writeDelta16 (docIds , count , min , out );
111
- break ;
112
- case BPV_21 :
113
- write21 (docIds , count , min , out );
114
- break ;
115
- case BPV_24 :
116
- write24 (docIds , count , min , out );
117
- break ;
118
- case BPV_32 :
119
- write32 (docIds , count , min , out );
120
- break ;
121
- default :
122
- throw new IOException ("Unsupported number of bits per value: " + encoding );
106
+ case CONTINUOUS_IDS -> writeContinuousIds (docIds , count , out );
107
+ case DELTA_BPV_16 -> writeDelta16 (docIds , count , min , out );
108
+ case BPV_21 -> write21 (docIds , count , min , out );
109
+ case BPV_24 -> write24 (docIds , count , min , out );
110
+ case BPV_32 -> write32 (docIds , count , min , out );
111
+ default -> throw new IOException ("Unsupported number of bits per value: " + encoding );
123
112
}
124
113
}
125
114
@@ -272,23 +261,12 @@ void readInts(IndexInput in, int count, byte encoding, int[] docIDs) throws IOEx
272
261
scratch = new int [count ];
273
262
}
274
263
switch (encoding ) {
275
- case CONTINUOUS_IDS :
276
- readContinuousIds (in , count , docIDs );
277
- break ;
278
- case DELTA_BPV_16 :
279
- readDelta16 (in , count , docIDs );
280
- break ;
281
- case BPV_21 :
282
- readInts21 (in , count , docIDs );
283
- break ;
284
- case BPV_24 :
285
- readInts24 (in , count , docIDs );
286
- break ;
287
- case BPV_32 :
288
- readInts32 (in , count , docIDs );
289
- break ;
290
- default :
291
- throw new IOException ("Unsupported number of bits per value: " + encoding );
264
+ case CONTINUOUS_IDS -> readContinuousIds (in , count , docIDs );
265
+ case DELTA_BPV_16 -> readDelta16 (in , count , docIDs );
266
+ case BPV_21 -> readInts21 (in , count , docIDs );
267
+ case BPV_24 -> readInts24 (in , count , docIDs );
268
+ case BPV_32 -> readInts32 (in , count , docIDs );
269
+ default -> throw new IOException ("Unsupported number of bits per value: " + encoding );
292
270
}
293
271
}
294
272
0 commit comments