Skip to content

Commit

Permalink
reduce useless extend code
Browse files Browse the repository at this point in the history
DeflateReadBodyMixin#each_fragment is overwritten by extend
DirectReadBodyMixin(l143).
And, we can't use DeflateReadBodyMixin#each_fragment,
because, we need compressed fragment size.
  • Loading branch information
takkanm committed Jul 9, 2015
1 parent 6bfbccb commit a07c6e9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/td/client/api/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,8 @@ def job_result_format(job_id, format, io=nil, &block)
raise_error("Get job result failed", res)
end

if ce = res.header['Content-Encoding']
res.extend(DeflateReadBodyMixin)
res.gzip = true if ce == 'gzip'
else
res.extend(DirectReadBodyMixin)
end

res.extend(DirectReadBodyMixin)

if ce = res.header['Content-Encoding']
if ce == 'gzip'
infl = Zlib::Inflate.new(Zlib::MAX_WBITS + 16)
Expand Down

0 comments on commit a07c6e9

Please sign in to comment.