[Groonga-commit] groonga/groonga at 1f2bd33 [master] ii: call function iff it's needed

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Aug 21 14:46:32 JST 2016


Kouhei Sutou	2016-08-21 14:46:32 +0900 (Sun, 21 Aug 2016)

  New Revision: 1f2bd336dc181032ecdd65a38950c1c1c28945d8
  https://github.com/groonga/groonga/commit/1f2bd336dc181032ecdd65a38950c1c1c28945d8

  Message:
    ii: call function iff it's needed

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+5 -3)
===================================================================
--- lib/ii.c    2016-08-21 14:44:41 +0900 (9dee00c)
+++ lib/ii.c    2016-08-21 14:46:32 +0900 (d9b57d3)
@@ -7602,8 +7602,6 @@ grn_ii_select_sequential_search_body(grn_ctx *ctx,
         grn_obj *value;
         const char *normalized_value;
         unsigned int normalized_value_length;
-        grn_id *rid;
-        grn_hash_cursor_get_key(ctx, cursor, (void **)&rid);
 
         GRN_BULK_REWIND(&buffer);
         grn_obj_get_value(ctx, accessor, id, &buffer);
@@ -7622,9 +7620,13 @@ grn_ii_select_sequential_search_body(grn_ctx *ctx,
                                NULL,
                                0);
         if (position != ONIG_MISMATCH) {
+          grn_id *record_id;
           grn_rset_posinfo info;
           double score;
-          info.rid = *rid;
+
+          grn_hash_cursor_get_key(ctx, cursor, (void **)&record_id);
+
+          info.rid = *record_id;
           info.sid = i + 1;
           info.pos = 0;
           score = get_weight(ctx, result, info.rid, info.sid, wvm, optarg);
-------------- next part --------------
HTML����������������������������...
Download 



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