[Groonga-commit] ranguba/rroonga at 472cf93 [use-grn-colmn-find-index-data] Don't use deprecated API anymore

Back to archive index

HAYASHI Kentaro null+****@clear*****
Fri Apr 3 18:17:56 JST 2015


HAYASHI Kentaro	2015-04-03 18:17:56 +0900 (Fri, 03 Apr 2015)

  New Revision: 472cf937b80d28305b4e7433b836e7b672d9d66d
  https://github.com/ranguba/rroonga/commit/472cf937b80d28305b4e7433b836e7b672d9d66d

  Message:
    Don't use deprecated API anymore
    
    grn_column_index is deprecated since Groonga 5.0.1

  Modified files:
    ext/groonga/rb-grn-column.c

  Modified: ext/groonga/rb-grn-column.c (+7 -8)
===================================================================
--- ext/groonga/rb-grn-column.c    2015-04-03 14:51:52 +0900 (e0ec8b3)
+++ ext/groonga/rb-grn-column.c    2015-04-03 18:17:56 +0900 (d3a81b5)
@@ -753,7 +753,7 @@ rb_grn_column_get_indexes (int argc, VALUE *argv, VALUE self)
 {
     grn_ctx *context;
     grn_obj *column;
-    grn_obj **indexes = NULL;
+    grn_index_datum *indexes = NULL;
     int i, n_indexes;
     grn_operator operator = GRN_OP_MATCH;
     VALUE rb_operator, rb_indexes;
@@ -769,19 +769,18 @@ rb_grn_column_get_indexes (int argc, VALUE *argv, VALUE self)
     }
 
     rb_indexes = rb_ary_new();
-    n_indexes = grn_column_index(context, column, operator,
-                                 NULL, 0, NULL);
+    n_indexes = grn_column_find_index_data(context, column, operator, NULL, 0);
     if (n_indexes == 0)
         return rb_indexes;
 
-    indexes = xmalloc(sizeof(grn_obj *) * n_indexes);
-    n_indexes = grn_column_index(context, column, operator,
-                                 indexes, n_indexes, NULL);
+    indexes = xmalloc(sizeof(grn_index_datum) * n_indexes);
+    n_indexes = grn_column_find_index_data(context, column, operator,
+                                           indexes, n_indexes);
     for (i = 0; i < n_indexes; i++) {
         VALUE rb_index;
-        rb_index = GRNOBJECT2RVAL(Qnil, context, indexes[i], GRN_FALSE);
+        rb_index = GRNOBJECT2RVAL(Qnil, context, indexes[i].index, GRN_FALSE);
         rb_ary_push(rb_indexes, rb_index);
-        grn_obj_unlink(context, indexes[i]);
+        grn_obj_unlink(context, indexes[i].index);
     }
     xfree(indexes);
     return rb_indexes;
-------------- next part --------------
HTML����������������������������...
Descargar 



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