regurgitator RubyGem user+dev discussion/patches/pulls/bug/help
 help / color / mirror / code / Atom feed
* [PATCH] file_request: favor &:method usage when possible
@ 2016-11-04 22:28 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-11-04 22:28 UTC (permalink / raw)
  To: regurgitator-public

This is less code for humans and also less bytecode for the
machine.
---
 lib/regurgitator/file_request.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/regurgitator/file_request.rb b/lib/regurgitator/file_request.rb
index 928618c..52deaf8 100644
--- a/lib/regurgitator/file_request.rb
+++ b/lib/regurgitator/file_request.rb
@@ -38,9 +38,9 @@ class Regurgitator::FileRequest < HTTP_Spew::Request # :nodoc:
     }
     PASS_HEADERS.each { |k| pass = env[k] and req[k] = pass }
     tmp = HTTP_Spew.wait(1, uri_group.map { |uris| new(req, uris) }, timeout)
-    tmp.delete_if { |t| t.error }
+    tmp.delete_if(&:error)
     ready = tmp.shift or raise Regurgitator::NoDevices, "no readable devices"
-    tmp.each { |t| t.close }
+    tmp.each(&:close)
     ready.response
   end
 end
-- 
EW


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

only message in thread, other threads:[~2016-11-04 22:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 22:28 [PATCH] file_request: favor &:method usage when possible Eric Wong

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

	https://yhbt.net/regurgitator.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).