From a73ab50d62e07f2d162c761d7364260480291778 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Mon, 23 Sep 2024 13:52:42 -0500 Subject: [PATCH] Remove unnecessary unaliasing allocation --- src/Inflate.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Inflate.jl b/src/Inflate.jl index b390326..45ea62e 100644 --- a/src/Inflate.jl +++ b/src/Inflate.jl @@ -255,7 +255,9 @@ function _inflate(data::InflateData) length = getlength(data, v) distance = getdist(data) if length <= distance - append!(out, @view out[(end - distance + 1):(end - distance + length)]) + ln = Base.length(out) + resize!(out, ln+length) + copyto!(out, ln+1, out, ln-distance+1, length) else for i = 1:length push!(out, out[end - distance + 1])