From 15ea47da9782379a1ad2d2285920f9b1a08feacf Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 7 Jan 2020 20:38:47 +1300 Subject: Prefer `Hash#[]` which is about 20% faster and more logical. --- lib/rack/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rack/response.rb b/lib/rack/response.rb index a3615cad..11f296b4 100644 --- a/lib/rack/response.rb +++ b/lib/rack/response.rb @@ -62,7 +62,7 @@ module Rack end def finish(&block) - if STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) + if STATUS_WITH_NO_ENTITY_BODY[status.to_i] delete_header CONTENT_TYPE delete_header CONTENT_LENGTH close -- cgit v1.2.1