diff options
author | Eric Wong <e@80x24.org> | 2016-06-06 05:00:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-06 05:00:11 +0000 |
commit | 133523706715b6e95d2bf410886560f21a23b1e8 (patch) | |
tree | 64784f3e72c166fe05f5fe43a544fccaf8688191 /lib/yahns/wbuf.rb | |
parent | 9f00d864e25e35ae6cb223b66a434965b14dbdca (diff) | |
download | yahns-133523706715b6e95d2bf410886560f21a23b1e8.tar.gz |
We can retrieve it when we actually need to create the temporary file. This saves an ivar slot and method dispatch parameters. This patch is nice, unfortunately the patch which follows is not :P
Diffstat (limited to 'lib/yahns/wbuf.rb')
-rw-r--r-- | lib/yahns/wbuf.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/yahns/wbuf.rb b/lib/yahns/wbuf.rb index 1010c86..583df10 100644 --- a/lib/yahns/wbuf.rb +++ b/lib/yahns/wbuf.rb @@ -32,9 +32,8 @@ class Yahns::Wbuf # :nodoc: include Yahns::WbufCommon attr_reader :busy - def initialize(body, persist, tmpdir) + def initialize(body, persist) @tmpio = nil - @tmpdir = tmpdir @sf_offset = @sf_count = 0 @wbuf_persist = persist # whether or not we keep the connection alive @body = body # something we call #close on when done writing @@ -58,7 +57,7 @@ class Yahns::Wbuf # :nodoc: @busy = rv end until @busy - @tmpio ||= Yahns::TmpIO.new(@tmpdir) + @tmpio ||= Yahns::TmpIO.new(c.class.output_buffer_tmpdir) @sf_count += String === buf ? @tmpio.write(buf) : wbuf_writev(buf) # we spent some time copying to the FS, try to write to |