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