File tree 1 file changed +14
-5
lines changed
compiler/src/dotty/tools/dotc/core/unpickleScala2 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -252,13 +252,22 @@ object PickleBuffer {
252
252
// Convert map so that it maps chunks of ChunkBits size at once
253
253
// instead of single bits.
254
254
def chunkMap (xs : Array [Long ]): FlagMap = {
255
- val chunked = Array .ofDim[Long ](
256
- (xs.length + ChunkBits - 1 ) / ChunkBits , ChunkSize )
257
- for (i <- 0 until chunked.length)
258
- for (j <- 0 until ChunkSize )
259
- for (k <- 0 until ChunkBits )
255
+ val size = (xs.length + ChunkBits - 1 ) / ChunkBits
256
+ val chunked = Array .ofDim[Long ](size, ChunkSize )
257
+ var i = 0
258
+ while (i < size) {
259
+ var j = 0
260
+ while (j < ChunkSize ) {
261
+ var k = 0
262
+ while (k < ChunkBits ) {
260
263
if ((j & (1 << k)) != 0 )
261
264
chunked(i)(j) |= xs(i * ChunkBits + k)
265
+ k += 1
266
+ }
267
+ j += 1
268
+ }
269
+ i += 1
270
+ }
262
271
chunked
263
272
}
264
273
You can’t perform that action at this time.
0 commit comments