yahns Ruby server user/dev discussion
 help / color / 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
-- 
EW


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

only message in thread, back to index

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

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.yahns

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox