lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [4/6] lucy git commit: Use ByteBuf in S_extract_tv_cache
Date Sun, 15 Nov 2015 11:43:21 GMT
Use ByteBuf in S_extract_tv_cache


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

Branch: refs/heads/master
Commit: 1554fa5becc18de2ca46d66bd1b93d8a3c47014b
Parents: 85204c5
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Tue Nov 10 13:33:54 2015 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sun Nov 15 12:38:48 2015 +0100

----------------------------------------------------------------------
 core/Lucy/Index/DocVector.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/1554fa5b/core/Lucy/Index/DocVector.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocVector.c b/core/Lucy/Index/DocVector.c
index 4868890..54dfedd 100644
--- a/core/Lucy/Index/DocVector.c
+++ b/core/Lucy/Index/DocVector.c
@@ -123,7 +123,7 @@ S_extract_tv_cache(Blob *field_buf) {
     Hash       *tv_cache  = Hash_new(0);
     const char *tv_string = Blob_Get_Buf(field_buf);
     int32_t     num_terms = NumUtil_decode_c32(&tv_string);
-    CharBuf    *text_buf  = CB_new(0);
+    ByteBuf    *text_buf  = BB_new(0);
 
     // Read the number of highlightable terms in the field.
     for (int32_t i = 0; i < num_terms; i++) {
@@ -131,8 +131,8 @@ S_extract_tv_cache(Blob *field_buf) {
         size_t   len     = NumUtil_decode_c32(&tv_string);
 
         // Decompress the term text.
-        CB_Set_Size(text_buf, overlap);
-        CB_Cat_Trusted_Utf8(text_buf, tv_string, len);
+        BB_Set_Size(text_buf, overlap);
+        BB_Cat_Bytes(text_buf, tv_string, len);
         tv_string += len;
 
         // Get positions & offsets string.
@@ -147,7 +147,7 @@ S_extract_tv_cache(Blob *field_buf) {
         len = tv_string - bookmark_ptr;
 
         // Store the $text => $posdata pair in the output hash.
-        String *text = CB_To_String(text_buf);
+        String *text = BB_Trusted_Utf8_To_String(text_buf);
         Hash_Store(tv_cache, text, (Obj*)Blob_new(bookmark_ptr, len));
         DECREF(text);
     }


Mime
View raw message