[Groonga-commit] ranguba/rroonga at 8201d06 [master] Remove needless checks

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Sep 2 18:36:26 JST 2015


Kouhei Sutou	2015-09-02 18:36:26 +0900 (Wed, 02 Sep 2015)

  New Revision: 8201d06ac146888f8e65f6df807e126111168676
  https://github.com/ranguba/rroonga/commit/8201d06ac146888f8e65f6df807e126111168676

  Message:
    Remove needless checks

  Modified files:
    ext/groonga/rb-grn-double-array-trie.c
    ext/groonga/rb-grn-patricia-trie.c

  Modified: ext/groonga/rb-grn-double-array-trie.c (+1 -8)
===================================================================
--- ext/groonga/rb-grn-double-array-trie.c    2015-08-28 20:12:16 +0900 (72745b6)
+++ ext/groonga/rb-grn-double-array-trie.c    2015-09-02 18:36:26 +0900 (3b1bfc4)
@@ -489,17 +489,10 @@ rb_grn_double_array_trie_open_grn_prefix_cursor (int argc, VALUE *argv,
     } else if (rb_grn_equal_option(rb_order_by, "id")) {
         flags |= GRN_CURSOR_BY_ID;
     } else if (rb_grn_equal_option(rb_order_by, "key")) {
-        if (table->header.type != GRN_TABLE_PAT_KEY) {
-            rb_raise(rb_eArgError,
-                     "order_by => :key is available "
-                     "only for Groonga::DoubleArrayTrie: %s",
-                     rb_grn_inspect(self));
-        }
         flags |= GRN_CURSOR_BY_KEY;
     } else {
         rb_raise(rb_eArgError,
-                 "order_by should be one of [:id%s]: %s",
-                 table->header.type == GRN_TABLE_PAT_KEY ? ", :key" : "",
+                 "order_by should be one of [:id, :key]: %s",
                  rb_grn_inspect(rb_order_by));
     }
 

  Modified: ext/groonga/rb-grn-patricia-trie.c (+1 -8)
===================================================================
--- ext/groonga/rb-grn-patricia-trie.c    2015-08-28 20:12:16 +0900 (c219c61)
+++ ext/groonga/rb-grn-patricia-trie.c    2015-09-02 18:36:26 +0900 (ba1b4d6)
@@ -565,17 +565,10 @@ rb_grn_patricia_trie_open_grn_prefix_cursor (int argc, VALUE *argv, VALUE self,
     } else if (rb_grn_equal_option(rb_order_by, "id")) {
         flags |= GRN_CURSOR_BY_ID;
     } else if (rb_grn_equal_option(rb_order_by, "key")) {
-        if (table->header.type != GRN_TABLE_PAT_KEY) {
-            rb_raise(rb_eArgError,
-                     "order_by => :key is available "
-                     "only for Groonga::PatriciaTrie: %s",
-                     rb_grn_inspect(self));
-        }
         flags |= GRN_CURSOR_BY_KEY;
     } else {
         rb_raise(rb_eArgError,
-                 "order_by should be one of [:id%s]: %s",
-                 table->header.type == GRN_TABLE_PAT_KEY ? ", :key" : "",
+                 "order_by should be one of [:id, :key]: %s",
                  rb_grn_inspect(rb_order_by));
     }
 
-------------- next part --------------
HTML����������������������������...
下載 



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