From 07603d3cfa019fe94310ad119b1f2d299a7abac6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 2 Jan 2021 20:35:18 +0000 Subject: [PATCH] Avoid copying the byte array in crc32() if possible Signed-off-by: Graham --- buffer/src/main/kotlin/org/openrs2/buffer/ByteBufExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buffer/src/main/kotlin/org/openrs2/buffer/ByteBufExtensions.kt b/buffer/src/main/kotlin/org/openrs2/buffer/ByteBufExtensions.kt index 901ac859..85108b04 100644 --- a/buffer/src/main/kotlin/org/openrs2/buffer/ByteBufExtensions.kt +++ b/buffer/src/main/kotlin/org/openrs2/buffer/ByteBufExtensions.kt @@ -109,7 +109,7 @@ public fun ByteBuf.crc32(index: Int, len: Int): Int { } } count == 1 -> crc.update(nioBuffer(index, len)) - else -> crc.update(ByteBufUtil.getBytes(this, index, len)) + else -> crc.update(ByteBufUtil.getBytes(this, index, len, false)) } return crc.value.toInt()