You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/09/07 18:53:40 UTC
[lucy-commits] [19/20] git commit: refs/heads/cfish-string-prep1 - Convert
Clownfish::VTable to StringIterator
Convert Clownfish::VTable to StringIterator
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/fed2b10a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/fed2b10a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/fed2b10a
Branch: refs/heads/cfish-string-prep1
Commit: fed2b10a3761d3d82bd6f392675670bc50b2e8b5
Parents: d7ed091
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Sep 7 18:06:54 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Sep 7 18:14:05 2013 +0200
----------------------------------------------------------------------
clownfish/runtime/core/Clownfish/VTable.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/fed2b10a/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
index 30ddea2..92ee50a 100644
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ b/clownfish/runtime/core/Clownfish/VTable.c
@@ -328,9 +328,9 @@ VTable_singleton(const String *class_name, VTable *parent) {
static String*
S_scrunch_string(String *source) {
CharBuf *buf = CB_new(Str_Get_Size(source));
- StackString *iterator = SSTR_WRAP(source);
- while (SStr_Get_Size(iterator)) {
- uint32_t code_point = SStr_Nibble(iterator);
+ StringIterator *iter = Str_Top(source);
+ uint32_t code_point;
+ while (STRITER_DONE != (code_point = StrIter_Next(iter))) {
if (code_point > 127) {
THROW(ERR, "Can't fold case for %o", source);
}
@@ -339,6 +339,7 @@ S_scrunch_string(String *source) {
}
}
String *retval = CB_Yield_String(buf);
+ DECREF(iter);
DECREF(buf);
return retval;
}