From b28cc988a0a0025f68fa162ecc6b7b6d735be0f4 Mon Sep 17 00:00:00 2001 From: TimG1964 <157401228+TimG1964@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:53:46 +0100 Subject: [PATCH] Simplify per suggestion from @nhz2 This should be faster because it avoids creating a String and there is a check of the uncompressed_size in https://github.com/JuliaIO/ZipArchives.jl/blob/f955785e237a0a8b3607cf651eaebc1eb1037b8c/src/reader.jl#L344 Co-authored-by: Nathan Zimmerberg <39104088+nhz2@users.noreply.github.com> --- src/read.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/read.jl b/src/read.jl index e66fc25..015bbbd 100644 --- a/src/read.jl +++ b/src/read.jl @@ -222,9 +222,7 @@ function open_or_read_xlsx(source::Union{IO, AbstractString}, read_files::Bool, elseif read_as_template # Binary and customXML files # we only read these files to save the Excel file later - bytes = read(IOBuffer(ZipArchives.zip_readentry(xf.io, f, String))) - @assert sizeof(bytes) == ZipArchives.zip_uncompressed_size(xf.io, i) - xf.binary_data[f] = bytes + xf.binary_data[f] = ZipArchives.zip_readentry(xf.io, f) end end