Skip to content

Commit

Permalink
Simplify per suggestion from @nhz2
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
TimG1964 and nhz2 authored Oct 9, 2024
1 parent d81e672 commit b28cc98
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/read.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b28cc98

Please sign in to comment.