[Groonga-commit] droonga/fluent-plugin-droonga at 23add9c [master] Use "or" instead of "||" for all logical OR operations

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 14 12:39:28 JST 2014


Kouhei Sutou	2014-02-14 12:39:28 +0900 (Fri, 14 Feb 2014)

  New Revision: 23add9c1d053804b7e7bb90d135f9e6a0b7f8c8a
  https://github.com/droonga/fluent-plugin-droonga/commit/23add9c1d053804b7e7bb90d135f9e6a0b7f8c8a

  Message:
    Use "or" instead of "||" for all logical OR operations

  Modified files:
    lib/droonga/catalog/base.rb
    lib/droonga/plugin/collector/basic.rb
    lib/droonga/plugin/planner/distributed_search_planner.rb
    lib/droonga/plugins/groonga/column_create.rb
    lib/droonga/plugins/groonga/table_remove.rb
    lib/droonga/searcher.rb
    lib/droonga/watcher.rb
    lib/fluent/plugin/out_droonga.rb

  Modified: lib/droonga/catalog/base.rb (+2 -2)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-13 17:45:23 +0900 (8abfc69)
+++ lib/droonga/catalog/base.rb    2014-02-14 12:39:28 +0900 (e985e90)
@@ -401,10 +401,10 @@ module Droonga
 
         datasets.each do |dataset_name, dataset|
           ring = dataset["ring"]
-          next if ring.nil? || !ring.is_a?(Hash)
+          next if ring.nil? or !ring.is_a?(Hash)
           ring.each do |ring_key, part|
             partitions_set = part["partitions"]
-            next if partitions_set.nil? || !partitions_set.is_a?(Hash)
+            next if partitions_set.nil? or !partitions_set.is_a?(Hash)
             partitions_set.each do |range, partitions|
               next unless partitions.is_a?(Array)
               partitions.each_with_index do |partition, index|

  Modified: lib/droonga/plugin/collector/basic.rb (+1 -1)
===================================================================
--- lib/droonga/plugin/collector/basic.rb    2014-02-13 17:45:23 +0900 (0b2c9ef)
+++ lib/droonga/plugin/collector/basic.rb    2014-02-14 12:39:28 +0900 (285f19d)
@@ -43,7 +43,7 @@ module Droonga
     end
 
     def reduce_value(deal, left_value, right_value)
-      if left_value.nil? || right_value.nil?
+      if left_value.nil? or right_value.nil?
         return right_value || left_value
       end
 

  Modified: lib/droonga/plugin/planner/distributed_search_planner.rb (+1 -1)
===================================================================
--- lib/droonga/plugin/planner/distributed_search_planner.rb    2014-02-13 17:45:23 +0900 (765385d)
+++ lib/droonga/plugin/planner/distributed_search_planner.rb    2014-02-14 12:39:28 +0900 (0db8ffe)
@@ -31,7 +31,7 @@ module Droonga
     end
 
     def plan
-      raise Searcher::NoQuery.new if****@queri*****? || @queries.empty?
+      raise Searcher::NoQuery.new if****@queri*****? or****@queri*****?
 
       Searcher::QuerySorter.validate_dependencies(@queries)
 

  Modified: lib/droonga/plugins/groonga/column_create.rb (+1 -1)
===================================================================
--- lib/droonga/plugins/groonga/column_create.rb    2014-02-13 17:45:23 +0900 (3772f1f)
+++ lib/droonga/plugins/groonga/column_create.rb    2014-02-14 12:39:28 +0900 (fc702af)
@@ -28,7 +28,7 @@ module Droonga
             @command = command_class.new("column_create", request)
 
             table_name = @command["table"]
-            if table_name.nil? || @context[table_name].nil?
+            if table_name.nil? or @context[table_name].nil?
               message = "table doesn't exist: <#{table_name.to_s}>"
               raise CommandError.new(:status => Status::INVALID_ARGUMENT,
                                      :message => message,

  Modified: lib/droonga/plugins/groonga/table_remove.rb (+1 -1)
===================================================================
--- lib/droonga/plugins/groonga/table_remove.rb    2014-02-13 17:45:23 +0900 (b1b1815)
+++ lib/droonga/plugins/groonga/table_remove.rb    2014-02-14 12:39:28 +0900 (790db05)
@@ -28,7 +28,7 @@ module Droonga
             @command = command_class.new("table_remove", request)
 
             name = @command["name"]
-            if name.nil? || @context[name].nil?
+            if name.nil? or @context[name].nil?
               raise CommandError.new(:status => Status::INVALID_ARGUMENT,
                                      :message => "table not found",
                                      :result => false)

  Modified: lib/droonga/searcher.rb (+1 -1)
===================================================================
--- lib/droonga/searcher.rb    2014-02-13 17:45:23 +0900 (d9889fe)
+++ lib/droonga/searcher.rb    2014-02-14 12:39:28 +0900 (0758e19)
@@ -70,7 +70,7 @@ module Droonga
     private
     def process_queries(queries)
       $log.trace("#{log_tag}: process_queries: start")
-      if queries.nil? || queries.empty?
+      if queries.nil? or queries.empty?
         raise NoQuery.new
       end
       $log.trace("#{log_tag}: process_queries: sort: start")

  Modified: lib/droonga/watcher.rb (+4 -4)
===================================================================
--- lib/droonga/watcher.rb    2014-02-13 17:45:23 +0900 (5720274)
+++ lib/droonga/watcher.rb    2014-02-14 12:39:28 +0900 (851ad09)
@@ -34,8 +34,8 @@ module Droonga
       route      = request[:route]
 
       # XXX better validation and error class must be written!!
-      if subscriber.nil? || subscriber.empty? || condition.nil? ||
-         query.nil? || route.nil?
+      if subscriber.nil? or subscriber.empty? or condition.nil? or
+         query.nil? or route.nil?
         raise "invalid request"
       end
       raise "too long query" if query.size > 4095
@@ -65,14 +65,14 @@ module Droonga
       subscriber = request[:subscriber]
       query      = request[:query]
 
-      if subscriber.nil? || subscriber.empty?
+      if subscriber.nil? or subscriber.empty?
         raise "invalid request"
       end
 
       subscriber_record = @subscriber_table[subscriber]
       return unless subscriber_record
 
-      if query.nil? || query.empty?
+      if query.nil? or query.empty?
         delete_subscriber(subscriber_record)
       else
         query_record = @query_table[query]

  Modified: lib/fluent/plugin/out_droonga.rb (+1 -1)
===================================================================
--- lib/fluent/plugin/out_droonga.rb    2014-02-13 17:45:23 +0900 (942c415)
+++ lib/fluent/plugin/out_droonga.rb    2014-02-14 12:39:28 +0900 (e1f9f14)
@@ -78,7 +78,7 @@ module Fluent
 
     def parse_record(tag, record)
       prefix, type, *arguments = tag.split(/\./)
-      if type.nil? || type.empty? || type == "message"
+      if type.nil? or type.empty? or type == "message"
         message = record
       else
         message = {
-------------- next part --------------
HTML����������������������������...
Download 



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