[Groonga-commit] droonga/droonga-engine at 9ea90c0 [master] Use the term "numeric" instead of "number"

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 22:45:06 JST 2015


YUKI Hiroshi	2015-04-21 22:45:06 +0900 (Tue, 21 Apr 2015)

  New Revision: 9ea90c0a4a91f6b9b88035fc02aa4be5ec082baf
  https://github.com/droonga/droonga-engine/commit/9ea90c0a4a91f6b9b88035fc02aa4be5ec082baf

  Message:
    Use the term "numeric" instead of "number"

  Modified files:
    lib/droonga/reducer.rb

  Modified: lib/droonga/reducer.rb (+7 -7)
===================================================================
--- lib/droonga/reducer.rb    2015-04-21 22:35:28 +0900 (59894c0)
+++ lib/droonga/reducer.rb    2015-04-21 22:45:06 +0900 (ca05e90)
@@ -91,8 +91,8 @@ module Droonga
       return x || y if x.nil? or y.nil?
 
       if x.is_a?(Hash) and y.is_a?(Hash)
-        if number_hash?(x) and number_hash?(y)
-          sum_number_hashes(x, y)
+        if numeric_hash?(x) and numeric_hash?(y)
+          sum_numeric_hashes(x, y)
         else
           x.merge(y)
         end
@@ -184,27 +184,27 @@ module Droonga
       end
     end
 
-    def number_hash?(hash)
+    def numeric_hash?(hash)
       return false unless hash.is_a?(Hash)
       hash.values.all? do |value|
         case value
         when Numeric
           true
         when Hash
-          number_hash?(value)
+          numeric_hash?(value)
         else
           false
         end
       end
     end
 
-    def sum_number_hashes(x, y)
+    def sum_numeric_hashes(x, y)
       sum = {}
       (x.keys + y.keys).each do |key|
         x_value = x[key]
         y_value = y[key]
-        if number_hash?(x_value) and number_hash?(y_value)
-          sum[key] = sum_number_hashes(x_value, y_value)
+        if numeric_hash?(x_value) and numeric_hash?(y_value)
+          sum[key] = sum_numeric_hashes(x_value, y_value)
         else
           sum[key] = (x_value || 0) + (y_value || 0)
         end
-------------- next part --------------
HTML����������������������������...
Download 



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