From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5B69420964 for ; Wed, 5 Apr 2017 01:21:29 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] rackup_handler: remove unnecessary branch Date: Wed, 5 Apr 2017 01:21:29 +0000 Message-Id: <20170405012129.20654-1-e@80x24.org> List-Id: No point in optimizing for the single listener case in setup code. --- lib/yahns/rackup_handler.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/yahns/rackup_handler.rb b/lib/yahns/rackup_handler.rb index 538e00d..63ab373 100644 --- a/lib/yahns/rackup_handler.rb +++ b/lib/yahns/rackup_handler.rb @@ -19,11 +19,7 @@ def self.run(app, o) app(:rack, app) do addr = o[:listen] || "#{o[:Host]||default_host}:#{o[:Port]||8080}" # allow listening to multiple addresses - if addr.include?(',') - addr.split(',').each { |l| listen(l) } - else - listen addr - end + addr.split(',').each { |l| listen(l) } val = o[:client_timeout] and client_timeout(val) end -- EW