diff options
author | Eric Wong <kcar-public@bogomips.org> | 2017-03-05 22:58:35 +0000 |
---|---|---|
committer | Eric Wong <kcar-public@bogomips.org> | 2017-03-05 22:58:35 +0000 |
commit | c72bf52b01bdd734204b4f414902fecd30aef948 (patch) | |
tree | 44b663932f850cc69cc9e0c5c16c803e5fab730e | |
parent | f685be5e654d956595c366b3a4278fb7e79a3e36 (diff) | |
download | kcar-c72bf52b01bdd734204b4f414902fecd30aef948.tar.gz |
Constant lookups are inline-cached in modern Rubies, so this is a waste of memory.
-rw-r--r-- | lib/kcar/response.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/kcar/response.rb b/lib/kcar/response.rb index c74bb4b..af15ca0 100644 --- a/lib/kcar/response.rb +++ b/lib/kcar/response.rb @@ -6,10 +6,6 @@ class Kcar::Response attr_accessor :sock, :hdr, :unchunk, :buf, :parser - # :stopdoc: - Parser = Kcar::Parser - # :startdoc: - # By default we readpartial at most 16K off a socket at once READ_SIZE = 0x4000 @@ -17,7 +13,8 @@ class Kcar::Response # method. +unchunk+ may be set to disable transparent unchunking # +hdr+ may be a Hash, Array, or Rack::Utils::HeaderHash def initialize(sock, hdr = {}, unchunk = true) - @sock, @hdr, @unchunk, @buf, @parser = sock, hdr, unchunk, "", Parser.new + @sock, @hdr, @unchunk, @buf = sock, hdr, unchunk, "" + @parser = Kcar::Parser.new end # returns a 3-element array that resembles a Rack response, but is |