use @+ operator instead of #dup to get unfrozen string
This commit is contained in:
parent
3bc85ccdec
commit
b326d17438
|
@ -25,7 +25,7 @@ module Zip
|
||||||
end
|
end
|
||||||
|
|
||||||
def buffer
|
def buffer
|
||||||
@buffer ||= ''.dup
|
@buffer ||= +''
|
||||||
end
|
end
|
||||||
|
|
||||||
def input_finished?
|
def input_finished?
|
||||||
|
|
|
@ -615,7 +615,7 @@ module Zip
|
||||||
get_input_stream do |is|
|
get_input_stream do |is|
|
||||||
bytes_written = 0
|
bytes_written = 0
|
||||||
warned = false
|
warned = false
|
||||||
buf = ''.dup
|
buf = +''
|
||||||
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
|
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
|
||||||
os << buf
|
os << buf
|
||||||
bytes_written += buf.bytesize
|
bytes_written += buf.bytesize
|
||||||
|
|
|
@ -26,7 +26,7 @@ module Zip
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_unknown_item
|
def create_unknown_item
|
||||||
s = ''.dup
|
s = +''
|
||||||
class << s
|
class << s
|
||||||
alias_method :to_c_dir_bin, :to_s
|
alias_method :to_c_dir_bin, :to_s
|
||||||
alias_method :to_local_bin, :to_s
|
alias_method :to_local_bin, :to_s
|
||||||
|
|
|
@ -402,7 +402,7 @@ module Zip
|
||||||
# Creates a directory
|
# Creates a directory
|
||||||
def mkdir(entryName, permissionInt = 0o755)
|
def mkdir(entryName, permissionInt = 0o755)
|
||||||
raise Errno::EEXIST, "File exists - #{entryName}" if find_entry(entryName)
|
raise Errno::EEXIST, "File exists - #{entryName}" if find_entry(entryName)
|
||||||
entryName = entryName.dup.to_s
|
entryName = +entryName.to_s
|
||||||
entryName << '/' unless entryName.end_with?('/')
|
entryName << '/' unless entryName.end_with?('/')
|
||||||
@entry_set << ::Zip::StreamableDirectory.new(@name, entryName, nil, permissionInt)
|
@entry_set << ::Zip::StreamableDirectory.new(@name, entryName, nil, permissionInt)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ module Zip
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
super
|
super
|
||||||
|
|
||||||
@buffer = ''.dup
|
@buffer = +''
|
||||||
@zlib_inflater = ::Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
@zlib_inflater = ::Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue