lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [03/50] [abbrv] git commit: refs/heads/master - Eliminate Str_Mimic_Str in PostingPool
Date Fri, 11 Oct 2013 13:31:41 GMT
Eliminate Str_Mimic_Str in PostingPool


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

Branch: refs/heads/master
Commit: f5219475b7d3d3e4f8022ca2e0f7167f79d65ac2
Parents: f042ed3
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Sep 9 22:43:37 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Fri Oct 11 15:28:13 2013 +0200

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/f5219475/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 0794bc4..86eab72 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -363,7 +363,6 @@ S_write_terms_and_postings(PostingPool *self, PostingWriter *post_writer,
     TermInfo      *const skip_tinfo       = TInfo_new(0);
     TermInfoIVARS *const tinfo_ivars      = TInfo_IVARS(tinfo);
     TermInfoIVARS *const skip_tinfo_ivars = TInfo_IVARS(skip_tinfo);
-    String        *const last_term_text   = Str_new(0);
     LexiconWriter *const lex_writer       = ivars->lex_writer;
     SkipStepper   *const skip_stepper     = ivars->skip_stepper;
     SkipStepperIVARS *const skip_stepper_ivars
@@ -378,7 +377,8 @@ S_write_terms_and_postings(PostingPool *self, PostingWriter *post_writer,
                               (*(RawPosting**)PostPool_Fetch(self)),
                               RAWPOSTING);
     RawPostingIVARS *post_ivars = RawPost_IVARS(posting);
-    Str_Mimic_Str(last_term_text, post_ivars->blob, post_ivars->content_len);
+    String *last_term_text
+        = Str_new_from_utf8(post_ivars->blob, post_ivars->content_len);
     char *last_text_buf = (char*)Str_Get_Ptr8(last_term_text);
     uint32_t last_text_size = Str_Get_Size(last_term_text);
     SkipStepper_Set_ID_And_Filepos(skip_stepper, 0, 0);
@@ -426,8 +426,9 @@ S_write_terms_and_postings(PostingPool *self, PostingWriter *post_writer,
             last_skip_filepos     = tinfo_ivars->post_filepos;
 
             // Remember the term_text so we can write string diffs.
-            Str_Mimic_Str(last_term_text, post_ivars->blob,
-                          post_ivars->content_len);
+            DECREF(last_term_text);
+            last_term_text
+                = Str_new_from_utf8(post_ivars->blob, post_ivars->content_len);
             last_text_buf  = (char*)Str_Get_Ptr8(last_term_text);
             last_text_size = Str_Get_Size(last_term_text);
         }


Mime
View raw message