[Groonga-commit] groonga/fluent-plugin-droonga at 83324f8 [master] Change hash of options destructively in parse_XXX methods in "table_create" command

Zurück zum Archiv-Index

Kosuke Asami null+****@clear*****
Thu Jul 11 13:07:07 JST 2013


Kosuke Asami	2013-07-11 13:07:07 +0900 (Thu, 11 Jul 2013)

  New Revision: 83324f8bc194a0379318de980fd841ab4b253277
  https://github.com/groonga/fluent-plugin-droonga/commit/83324f8bc194a0379318de980fd841ab4b253277

  Message:
    Change hash of options destructively in parse_XXX methods in "table_create" command

  Modified files:
    lib/droonga/plugin/groonga/table_create.rb

  Modified: lib/droonga/plugin/groonga/table_create.rb (+7 -9)
===================================================================
--- lib/droonga/plugin/groonga/table_create.rb    2013-07-11 13:03:26 +0900 (c164c29)
+++ lib/droonga/plugin/groonga/table_create.rb    2013-07-11 13:07:07 +0900 (fe2ba09)
@@ -36,14 +36,14 @@ module Droonga
       private
       def parse_request(request)
         options = {}
-        options.merge!(parse_flags(request))
-        options.merge!(parse_key_type(request))
-        options.merge!(parse_value_type(request))
+        parse_flags(options, request)
+        parse_key_type(options, request)
+        parse_value_type(options, request)
         options
       end
 
-      def parse_flags(request)
-        options = {:type => :hash}
+      def parse_flags(options, request)
+        options[:type] = :hash
         if request["flags"]
           request["flags"].split(/\|/).each do |flag|
             case flag
@@ -66,14 +66,12 @@ module Droonga
         options
       end
 
-      def parse_key_type(request)
-        options = {}
+      def parse_key_type(options, request)
         options[:key_type] = request["key_type"] if request["key_type"]
         options
       end
 
-      def parse_value_type(request)
-        options = {}
+      def parse_value_type(options, request)
         options[:value_type] = request["value_type"] if request["value_type"]
         options
       end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index