make parse_zip64_extra check for empty @extra['Zip64'] easier to read

This commit is contained in:
Pavel.Lobashov 2015-03-20 22:54:28 +03:00
parent 5d47830624
commit d928aeebe5
1 changed files with 5 additions and 6 deletions

View File

@ -639,12 +639,11 @@ module Zip
# apply missing data from the zip64 extra information field, if present # apply missing data from the zip64 extra information field, if present
# (required when file sizes exceed 2**32, but can be used for all files) # (required when file sizes exceed 2**32, but can be used for all files)
def parse_zip64_extra(for_local_header) #:nodoc:all def parse_zip64_extra(for_local_header) #:nodoc:all
if zip64 = @extra['Zip64'] return if @extra['Zip64'].nil?
if for_local_header if for_local_header
@size, @compressed_size = zip64.parse(@size, @compressed_size) @size, @compressed_size = @extra['Zip64'].parse(@size, @compressed_size)
else else
@size, @compressed_size, @local_header_offset = zip64.parse(@size, @compressed_size, @local_header_offset) @size, @compressed_size, @local_header_offset = @extra['Zip64'].parse(@size, @compressed_size, @local_header_offset)
end
end end
end end