From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: unicorn-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4D7931FA57; Fri, 5 Jun 2015 08:49:06 +0000 (UTC) From: Eric Wong To: unicorn-public@bogomips.org Cc: Eric Wong Subject: [PATCH] http_response: simplify regular expression Date: Fri, 5 Jun 2015 08:49:01 +0000 Message-Id: <1433494141-15968-1-git-send-email-e@80x24.org> List-Id: It's ugly and less-readable to have redundant \z statements, and according to ObjectSpace.memsize_of, this saves 4 bytes on x86-64. --- lib/unicorn/http_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index c9c2de8..801bf9a 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -33,7 +33,7 @@ module Unicorn::HttpResponse "Connection: close\r\n" headers.each do |key, value| case key - when %r{\A(?:Date\z|Connection\z)}i + when %r{\A(?:Date|Connection)\z}i next when "rack.hijack" # This should only be hit under Rack >= 1.5, as this was an illegal -- EW