Switch over to StrIter_crop

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

Branch: refs/heads/master
Commit: 25759e0970dedc847e87828becb80f825f7f32a5
Parents: 24a5ac4
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Wed Oct 28 18:06:43 2015 +0100
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Wed Oct 28 18:06:43 2015 +0100

----------------------------------------------------------------------
 core/Lucy/Highlight/Highlighter.c         | 10 +++++-----
 core/Lucy/Search/QueryParser.c            |  2 +-
 core/Lucy/Search/QueryParser/QueryLexer.c |  6 +++---
 core/Lucy/Store/Folder.c                  |  4 ++--
 core/Lucy/Util/IndexFileNames.c           |  4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/25759e09/core/Lucy/Highlight/Highlighter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Highlight/Highlighter.c 
b/core/Lucy/Highlight/Highlighter.c
index d1c3b6c..f88b814 100644
--- a/core/Lucy/Highlight/Highlighter.c
+++ b/core/Lucy/Highlight/Highlighter.c
@@ -434,7 +434,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, String 
*field_val,
         raw_excerpt = Str_new_from_trusted_utf8("", 0);
     }
     else {
-        String  *substring = StrIter_substring(top, tail);
+        String  *substring = StrIter_crop(top, tail);
         CharBuf *buf       = CB_new(Str_Get_Size(substring) + 8);
 
         // If not starting on a sentence boundary, prepend an ellipsis.
@@ -499,7 +499,7 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, Vector 
*spans,
                     int32_t highlighted_len = hl_end - hl_start;
                     StrIter_Assign(temp, iter);
                     StrIter_Advance(iter, highlighted_len);
-                    String *to_cat = StrIter_substring(temp, iter);
+                    String *to_cat = StrIter_crop(temp, iter);
                     String *encoded = S_do_encode(self, to_cat, &encode_buf);
                     String *hl_frag = Highlighter_Highlight(self, encoded);
                     CB_Cat(buf, hl_frag);
@@ -511,7 +511,7 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, Vector 
*spans,
                 int32_t non_highlighted_len = relative_start - hl_end;
                 StrIter_Assign(temp, iter);
                 StrIter_Advance(iter, non_highlighted_len);
-                String *to_cat = StrIter_substring(temp, iter);
+                String *to_cat = StrIter_crop(temp, iter);
                 String *encoded = S_do_encode(self, to_cat, &encode_buf);
                 CB_Cat(buf, (String*)encoded);
                 DECREF(encoded);
@@ -528,7 +528,7 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, Vector 
*spans,
         int32_t highlighted_len = hl_end - hl_start;
         StrIter_Assign(temp, iter);
         StrIter_Advance(iter, highlighted_len);
-        String *to_cat = StrIter_substring(temp, iter);
+        String *to_cat = StrIter_crop(temp, iter);
         String *encoded = S_do_encode(self, to_cat, &encode_buf);
         String *hl_frag = Highlighter_Highlight(self, encoded);
         CB_Cat(buf, hl_frag);
@@ -539,7 +539,7 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, Vector 
*spans,
 
     // Last text, beyond last highlight span.
     if (StrIter_Has_Next(iter)) {
-        String *to_cat = StrIter_substring(iter, NULL);
+        String *to_cat = StrIter_crop(iter, NULL);
         String *encoded = S_do_encode(self, to_cat, &encode_buf);
         CB_Cat(buf, encoded);
         DECREF(encoded);

http://git-wip-us.apache.org/repos/asf/lucy/blob/25759e09/core/Lucy/Search/QueryParser.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser.c b/core/Lucy/Search/QueryParser.c
index 7a41539..32736d5 100644
--- a/core/Lucy/Search/QueryParser.c
+++ b/core/Lucy/Search/QueryParser.c
@@ -885,7 +885,7 @@ QParser_Expand_Leaf_IMP(QueryParser *self, Query *query) {
             StrIter_Recede(tail, 1);
         }
     }
-    String *source_text = StrIter_substring(top, tail);
+    String *source_text = StrIter_crop(top, tail);
 
     // Either use LeafQuery's field or default to Parser's list.
     Vector *fields;

http://git-wip-us.apache.org/repos/asf/lucy/blob/25759e09/core/Lucy/Search/QueryParser/QueryLexer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser/QueryLexer.c 
b/core/Lucy/Search/QueryParser/QueryLexer.c
index bee1b08..c86c690 100644
--- a/core/Lucy/Search/QueryParser/QueryLexer.c
+++ b/core/Lucy/Search/QueryParser/QueryLexer.c
@@ -235,7 +235,7 @@ S_consume_field(StringIterator *iter) {
 
     // Consume string data.
     StrIter_Recede(temp, 2); // Back up over lookahead and colon.
-    String *field = StrIter_substring(iter, temp);
+    String *field = StrIter_crop(iter, temp);
     StrIter_Advance(temp, 1); // Skip colon.
     StrIter_Assign(iter, temp);
     DECREF(temp);
@@ -267,7 +267,7 @@ S_consume_text(StringIterator *iter) {
         }
     }
 
-    String *text = StrIter_substring(iter, temp);
+    String *text = StrIter_crop(iter, temp);
     StrIter_Assign(iter, temp);
     DECREF(temp);
     return ParserElem_new(TOKEN_STRING, (Obj*)text);
@@ -291,7 +291,7 @@ S_consume_quoted_string(StringIterator *iter) {
         }
     }
 
-    String *text = StrIter_substring(iter, temp);
+    String *text = StrIter_crop(iter, temp);
     StrIter_Assign(iter, temp);
     DECREF(temp);
     return ParserElem_new(TOKEN_STRING, (Obj*)text);

http://git-wip-us.apache.org/repos/asf/lucy/blob/25759e09/core/Lucy/Store/Folder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Folder.c b/core/Lucy/Store/Folder.c
index cf4a204..2c456a7 100644
--- a/core/Lucy/Store/Folder.c
+++ b/core/Lucy/Store/Folder.c
@@ -442,7 +442,7 @@ S_enclosing_folder(Folder *self, StringIterator *path) {
     while (STR_OOB != (code_point = StrIter_Next(iter))) {
         if (code_point == '/' && StrIter_Has_Next(iter)) {
             StrIter_Recede(iter, 1);
-            path_component = StrIter_substring(path, iter);
+            path_component = StrIter_crop(path, iter);
             StrIter_Advance(iter, 1);
             StrIter_Assign(path, iter);
             break;
@@ -485,7 +485,7 @@ Folder_Find_Folder_IMP(Folder *self, String *path) {
         StringIterator *iter = Str_Top(path);
         Folder *enclosing_folder = S_enclosing_folder(self, iter);
         if (enclosing_folder) {
-            String *folder_name = StrIter_substring(iter, NULL);
+            String *folder_name = StrIter_crop(iter, NULL);
             folder = Folder_Local_Find_Folder(enclosing_folder, folder_name);
             DECREF(folder_name);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/25759e09/core/Lucy/Util/IndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/IndexFileNames.c b/core/Lucy/Util/IndexFileNames.c
index bd203cb..550995e 100644
--- a/core/Lucy/Util/IndexFileNames.c
+++ b/core/Lucy/Util/IndexFileNames.c
@@ -61,7 +61,7 @@ IxFileNames_extract_gen(String *name) {
         else if (code_point == '_') { break; }
     }
 
-    String *num_string = StrIter_substring(iter, NULL);
+    String *num_string = StrIter_crop(iter, NULL);
     uint64_t retval = (uint64_t)Str_BaseX_To_I64(num_string, 36);
 
     DECREF(num_string);
@@ -91,7 +91,7 @@ IxFileNames_local_part(String *path) {
         code_point = StrIter_Prev(top);
     }
 
-    String *retval = StrIter_substring(top, tail);
+    String *retval = StrIter_crop(top, tail);
 
     DECREF(tail);
     DECREF(top);

Reply via email to