yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] rackup_handler: remove unnecessary branch
@ 2017-04-05  1:21 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-04-05  1:21 UTC (permalink / raw)
  To: yahns-public

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
-- 
@@ -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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-05  1:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05  1:21 [PATCH] rackup_handler: remove unnecessary branch Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/yahns.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).