# HG changeset patch # User wenzelm # Date 1666450577 -7200 # Node ID 3b9f36ef7365fd18cd87ec1d20bf77e813768676 # Parent cff0828c374f721991aff33734c4b25d18612a08 tuned: avoid redundant copy of potentially large array; diff -r cff0828c374f -r 3b9f36ef7365 src/Pure/General/bytes.scala --- a/src/Pure/General/bytes.scala Fri Oct 21 21:39:38 2022 +0200 +++ b/src/Pure/General/bytes.scala Sat Oct 22 16:56:17 2022 +0200 @@ -238,7 +238,7 @@ new Bytes(result.toByteArray, 0, result.size) case options_zstd: Compress.Options_Zstd => Zstd.init() - Bytes(zstd.Zstd.compress(array, options_zstd.level)) + Bytes(zstd.Zstd.compress(if (offset == 0) bytes else array, options_zstd.level)) } }