[Groonga-commit] droonga/droonga-engine at 38485c1 [master] Use guard unless style

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jun 26 13:56:46 JST 2014


YUKI Hiroshi	2014-06-26 13:56:46 +0900 (Thu, 26 Jun 2014)

  New Revision: 38485c1de2a8d2e9aa29daaaaf1b06290103cbb2
  https://github.com/droonga/droonga-engine/commit/38485c1de2a8d2e9aa29daaaaf1b06290103cbb2

  Message:
    Use guard unless style

  Modified files:
    lib/droonga/command/serf_event_handler.rb

  Modified: lib/droonga/command/serf_event_handler.rb (+5 -5)
===================================================================
--- lib/droonga/command/serf_event_handler.rb    2014-06-26 13:50:17 +0900 (eda34e6)
+++ lib/droonga/command/serf_event_handler.rb    2014-06-26 13:56:46 +0900 (c9da937)
@@ -59,11 +59,11 @@ module Droonga
         members = `#{@serf} members -rpc-addr #{@serf_rpc_address}`
         members.each_line do |member|
           name, address, status, = member.strip.split(/\s+/)
-          if status == "alive"
-            nodes[name] = {
-              "serfAddress" => address,
-            }
-          end
+          next unless status == "alive"
+
+          nodes[name] = {
+            "serfAddress" => address,
+          }
         end
         nodes
       end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index