From 6494d965735fc9eeaffa1c92e30ac0f106bf0df1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Feb 2011 11:08:10 +0000 Subject: kcar/response: a few more micro-optimizations Whee! --- lib/kcar/response.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/kcar/response.rb b/lib/kcar/response.rb index 4764d8b..94e8825 100644 --- a/lib/kcar/response.rb +++ b/lib/kcar/response.rb @@ -119,10 +119,10 @@ class Kcar::Response def each_until_eof yield @buf unless @buf.empty? # easy, just read and write everything until EOFError - dst = sock.readpartial(READ_SIZE) + dst = @sock.readpartial(READ_SIZE) begin yield dst - end while sock.readpartial(READ_SIZE, dst) + end while @sock.readpartial(READ_SIZE, dst) end def each_identity @@ -166,7 +166,7 @@ class Kcar::Response # we can't pass trailers to the client since we unchunk # the response, so just read them off the socket and # stash them in hdr just in case... - until parser.headers(@hdr, @buf) + until @parser.headers(@hdr, @buf) @buf << @sock.readpartial(READ_SIZE, dst) end end -- cgit v1.2.3-24-ge0c7