Use guard instead of if else construct
This commit is contained in:
parent
99d8f59eaf
commit
0fee529de5
|
@ -14,12 +14,10 @@ module Zip
|
|||
@crc = Zlib.crc32(val, @crc)
|
||||
@size += val.bytesize
|
||||
buffer = @zlib_deflater.deflate(data, Zlib::SYNC_FLUSH)
|
||||
if buffer.empty?
|
||||
@output_stream
|
||||
else
|
||||
return @output_stream if buffer.empty?
|
||||
|
||||
@output_stream << @encrypter.encrypt(buffer)
|
||||
end
|
||||
end
|
||||
|
||||
def finish
|
||||
buffer = @zlib_deflater.finish
|
||||
|
|
Loading…
Reference in New Issue