From c72bf52b01bdd734204b4f414902fecd30aef948 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Mar 2017 22:58:35 +0000 Subject: response: remove unnecessary constant alias Constant lookups are inline-cached in modern Rubies, so this is a waste of memory. --- lib/kcar/response.rb | 7 ++----- 1 file 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 -- cgit v1.2.3-24-ge0c7