|
|
@ -103,11 +103,7 @@ public fun ByteBuf.crc32(index: Int, len: Int): Int { |
|
|
|
|
|
|
|
|
|
|
|
when { |
|
|
|
when { |
|
|
|
hasArray() -> crc.update(array(), arrayOffset() + index, len) |
|
|
|
hasArray() -> crc.update(array(), arrayOffset() + index, len) |
|
|
|
count > 1 -> { |
|
|
|
count > 1 -> nioBuffers(index, len).forEach(crc::update) |
|
|
|
for (b in nioBuffers(index, len)) { |
|
|
|
|
|
|
|
crc.update(b) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
count == 1 -> crc.update(nioBuffer(index, len)) |
|
|
|
count == 1 -> crc.update(nioBuffer(index, len)) |
|
|
|
else -> crc.update(ByteBufUtil.getBytes(this, index, len, false)) |
|
|
|
else -> crc.update(ByteBufUtil.getBytes(this, index, len, false)) |
|
|
|
} |
|
|
|
} |
|
|
|