lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [03/11] git commit: refs/heads/ivars-wip1 - Fixup Lucy Analysis classes IVARS glitches.
Date Thu, 11 Jul 2013 22:33:28 GMT
Fixup Lucy Analysis classes IVARS glitches.

(Will be folded into earlier commit before merging to master.)


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/cc067602
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/cc067602
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/cc067602

Branch: refs/heads/ivars-wip1
Commit: cc067602215781e19922a1dc50450c8360169b25
Parents: d12c4e2
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Thu Jul 11 15:00:14 2013 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Thu Jul 11 15:00:14 2013 -0700

----------------------------------------------------------------------
 core/Lucy/Analysis/Inversion.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/cc067602/core/Lucy/Analysis/Inversion.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/Inversion.c b/core/Lucy/Analysis/Inversion.c
index 4f1ff7e..9a3fb34 100644
--- a/core/Lucy/Analysis/Inversion.c
+++ b/core/Lucy/Analysis/Inversion.c
@@ -151,12 +151,13 @@ Inversion_invert(Inversion *self) {
 
     // Assign token positions.
     for (; tokens < limit; tokens++) {
-        Token *const cur_token = *tokens;
-        cur_token->pos = token_pos;
-        token_pos = (int32_t)((uint32_t)token_pos + (uint32_t)cur_token->pos_inc);
-        if (token_pos < cur_token->pos) {
+        TokenIVARS *const cur_token_ivars = Token_IVARS(*tokens);
+        cur_token_ivars->pos = token_pos;
+        token_pos = (int32_t)((uint32_t)token_pos
+                              + (uint32_t)cur_token_ivars->pos_inc);
+        if (token_pos < cur_token_ivars->pos) {
             THROW(ERR, "Token positions out of order: %i32 %i32",
-                  cur_token->pos, token_pos);
+                  cur_token_ivars->pos, token_pos);
         }
     }
 
@@ -178,17 +179,16 @@ S_count_clusters(Inversion *self, InversionIVARS *ivars) {
     ivars->cluster_counts = counts;
 
     for (uint32_t i = 0; i < ivars->size;) {
-        Token *const base_token = tokens[i];
-        char  *const base_text  = base_token->text;
-        const size_t base_len   = base_token->len;
+        TokenIVARS *const base_token_ivars = Token_IVARS(tokens[i]);
+        char  *const base_text  = base_token_ivars->text;
+        const size_t base_len   = base_token_ivars->len;
         uint32_t     j          = i + 1;
 
         // Iterate through tokens until text doesn't match.
         while (j < ivars->size) {
-            Token *const candidate = tokens[j];
-
-            if ((candidate->len == base_len)
-                && (memcmp(candidate->text, base_text, base_len) == 0)
+            TokenIVARS *const candidate_ivars = Token_IVARS(tokens[j]);
+            if ((candidate_ivars->len == base_len)
+                && (memcmp(candidate_ivars->text, base_text, base_len) == 0)
                ) {
                 j++;
             }


Mime
View raw message