[Groonga-commit] groonga/groonga at f3c8251 [master] ii: use POS_EMBED macros

Zurück zum Archiv-Index
Kouhei Sutou null+****@clear*****
Fri Apr 5 17:22:38 JST 2019


Kouhei Sutou	2019-04-05 17:22:38 +0900 (Fri, 05 Apr 2019)

  Revision: f3c82511961eb388df7aef9e5c9b54b9ed4a2707
  https://github.com/groonga/groonga/commit/f3c82511961eb388df7aef9e5c9b54b9ed4a2707

  Message:
    ii: use POS_EMBED macros

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+2 -2)
===================================================================
--- lib/ii.c    2019-04-05 16:06:04 +0900 (4893a78cb)
+++ lib/ii.c    2019-04-05 17:22:38 +0900 (cd41e9340)
@@ -4405,7 +4405,7 @@ buffer_merge(grn_ctx *ctx, grn_ii *ii, uint32_t seg, grn_hash *h,
                    data.last_id.sid < 0x800 &&
                    data.last_id.tf == 1 &&
                    data.last_id.weight == 0) {
-          a[0] = (data.last_id.rid << 12) + (data.last_id.sid << 1) + 1;
+          a[0] = POS_EMBED_RID_SID(data.last_id.rid, data.last_id.sid);
           if (ii->header.common->flags & GRN_OBJ_WITH_POSITION) {
             a[1] = data.dest.position_gaps[-1];
           } else {
@@ -4418,7 +4418,7 @@ buffer_merge(grn_ctx *ctx, grn_ii *ii, uint32_t seg, grn_hash *h,
                    ndf == 1 &&
                    data.last_id.tf == 1 &&
                    data.last_id.weight == 0) {
-          a[0] = (data.last_id.rid << 1) + 1;
+          a[0] = POS_EMBED_RID(data.last_id.rid);
           if (ii->header.common->flags & GRN_OBJ_WITH_POSITION) {
             a[1] = data.dest.position_gaps[-1];
           } else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190405/83517c94/attachment.html>


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