lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [01/15] git commit: refs/heads/cfish-string-prep1 - Convert Search::Compiler to CharBuf
Date Mon, 02 Sep 2013 19:16:32 GMT
Updated Branches:
  refs/heads/cfish-string-prep1 976a687ff -> 56fb0e1dd


Convert Search::Compiler to CharBuf


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

Branch: refs/heads/cfish-string-prep1
Commit: 04e9f412c61b29f8471dab48cfff43695ad16ef2
Parents: 976a687
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Sep 2 19:32:11 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Sep 2 19:32:11 2013 +0200

----------------------------------------------------------------------
 core/Lucy/Search/Compiler.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/04e9f412/core/Lucy/Search/Compiler.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Compiler.c b/core/Lucy/Search/Compiler.c
index 1b82cb7..4ffa29d 100644
--- a/core/Lucy/Search/Compiler.c
+++ b/core/Lucy/Search/Compiler.c
@@ -18,6 +18,8 @@
 #include "Lucy/Util/ToolSet.h"
 
 #include "Lucy/Search/Compiler.h"
+
+#include "Clownfish/CharBuf.h"
 #include "Lucy/Index/SegReader.h"
 #include "Lucy/Index/DocVector.h"
 #include "Lucy/Index/Similarity.h"
@@ -107,9 +109,11 @@ String*
 Compiler_To_String_IMP(Compiler *self) {
     CompilerIVARS *const ivars = Compiler_IVARS(self);
     String *stringified_query = Query_To_String(ivars->parent);
-    String *string = Str_new_from_trusted_utf8("compiler(", 9);
-    Str_Cat(string, stringified_query);
-    Str_Cat_Trusted_Str(string, ")", 1);
+    CharBuf *buf = CB_new_from_trusted_utf8("compiler(", 9);
+    CB_Cat(buf, stringified_query);
+    CB_Cat_Trusted_UTF8(buf, ")", 1);
+    String *string = CB_Yield_String(buf);
+    DECREF(buf);
     DECREF(stringified_query);
     return string;
 }


Mime
View raw message