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,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0A8DF1F6A8 for ; Fri, 6 Feb 2015 23:12:15 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] extras/proxy_pass: save memory in String#split arg Date: Fri, 6 Feb 2015 23:12:14 +0000 Message-Id: <1423264334-14306-1-git-send-email-e@80x24.org> List-Id: This saves over 400 bytes of memory in a cold code path. --- extras/proxy_pass.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/proxy_pass.rb b/extras/proxy_pass.rb index e7127d3..b1697db 100644 --- a/extras/proxy_pass.rb +++ b/extras/proxy_pass.rb @@ -117,7 +117,7 @@ class ProxyPass # :nodoc: case dest when %r{\Ahttp://([^/]+)(/.*)\z} path = $2 - host, port = $1.split(/:/) + host, port = $1.split(':') @sockaddr = Socket.sockaddr_in(port || 80, host) # methods from Rack::Request we want: -- EW