lucy-commits mailing list archives

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


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

Branch: refs/heads/master
Commit: 062c39b2689a1551c37062ca0f1124d88422a63f
Parents: 522588c
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Sep 8 12:11:15 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Fri Oct 11 15:28:13 2013 +0200

----------------------------------------------------------------------
 c/src/Lucy/Index/Inverter.c   | 8 +++-----
 core/Lucy/Index/Inverter.c    | 8 ++++----
 perl/xs/Lucy/Index/Inverter.c | 7 ++++---
 3 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/062c39b2/c/src/Lucy/Index/Inverter.c
----------------------------------------------------------------------
diff --git a/c/src/Lucy/Index/Inverter.c b/c/src/Lucy/Index/Inverter.c
index 99b5579..b5882c2 100644
--- a/c/src/Lucy/Index/Inverter.c
+++ b/c/src/Lucy/Index/Inverter.c
@@ -80,11 +80,9 @@ Inverter_Invert_Doc_IMP(Inverter *self, Doc *doc) {
         // Get the field value.
         switch (FType_Primitive_ID(type) & FType_PRIMITIVE_ID_MASK) {
             case FType_TEXT: {
-                    String *char_buf
-                        = (String*)CERTIFY(obj, STRING);
-                    ViewCharBuf *value
-                        = (ViewCharBuf*)inventry_ivars->value;
-                    ViewCB_Assign(value, char_buf);
+                    String *string = (String*)CERTIFY(obj, STRING);
+                    DECREF(inventry_ivars->value);
+                    inventry_ivars->value = INCREF(string);
                     break;
                 }
             case FType_BLOB: {

http://git-wip-us.apache.org/repos/asf/lucy/blob/062c39b2/core/Lucy/Index/Inverter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Inverter.c b/core/Lucy/Index/Inverter.c
index 3c70742..0147732 100644
--- a/core/Lucy/Index/Inverter.c
+++ b/core/Lucy/Index/Inverter.c
@@ -164,9 +164,9 @@ Inverter_Add_Field_IMP(Inverter *self, InverterEntry *entry) {
         Inversion_Invert(entry_ivars->inversion);
     }
     else if (entry_ivars->indexed || entry_ivars->highlightable) {
-        ViewCharBuf *value = (ViewCharBuf*)entry_ivars->value;
-        size_t token_len = ViewCB_Get_Size(value);
-        Token *seed = Token_new((char*)ViewCB_Get_Ptr8(value),
+        String *value = (String*)entry_ivars->value;
+        size_t token_len = Str_Get_Size(value);
+        Token *seed = Token_new((char*)Str_Get_Ptr8(value),
                                 token_len, 0, token_len, 1.0f, 1);
         DECREF(entry_ivars->inversion);
         entry_ivars->inversion = Inversion_new(seed);
@@ -215,7 +215,7 @@ InvEntry_init(InverterEntry *self, Schema *schema, const String *field,
         uint8_t prim_id = FType_Primitive_ID(ivars->type);
         switch (prim_id & FType_PRIMITIVE_ID_MASK) {
             case FType_TEXT:
-                ivars->value = (Obj*)ViewCB_new_from_trusted_utf8(NULL, 0);
+                ivars->value = NULL;
                 break;
             case FType_BLOB:
                 ivars->value = (Obj*)ViewBB_new(NULL, 0);

http://git-wip-us.apache.org/repos/asf/lucy/blob/062c39b2/perl/xs/Lucy/Index/Inverter.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Index/Inverter.c b/perl/xs/Lucy/Index/Inverter.c
index 093c1d4..67116e0 100644
--- a/perl/xs/Lucy/Index/Inverter.c
+++ b/perl/xs/Lucy/Index/Inverter.c
@@ -99,9 +99,10 @@ LUCY_Inverter_Invert_Doc_IMP(lucy_Inverter *self, lucy_Doc *doc) {
             case lucy_FType_TEXT: {
                     STRLEN val_len;
                     char *val_ptr = SvPVutf8(value_sv, val_len);
-                    cfish_ViewCharBuf *value
-                        = (cfish_ViewCharBuf*)entry_ivars->value;
-                    CFISH_ViewCB_Assign_Str(value, val_ptr, val_len);
+                    CFISH_DECREF(entry_ivars->value);
+                    entry_ivars->value
+                        = (cfish_Obj*)cfish_ViewCB_new_from_trusted_utf8(
+                                val_ptr, val_len);
                     break;
                 }
             case lucy_FType_BLOB: {


Mime
View raw message