Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: test/cctest/test-strings.cc

Issue 663313003: Cleanup ConsStringIteratorOp. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/string-stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 7ff636bfee574f6026d5df08fb1372df9daf14ac..76c1612c8742e2bf5006bee64bc50652a55b8b35 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -357,10 +357,10 @@ void AccumulateStats(Handle<String> cons_string, ConsStringStats* stats) {
void AccumulateStatsWithOperator(
ConsString* cons_string, ConsStringStats* stats) {
- ConsStringIteratorOp op(cons_string);
+ ConsStringIterator iter(cons_string);
String* string;
int offset;
- while (NULL != (string = op.Next(&offset))) {
+ while (NULL != (string = iter.Next(&offset))) {
// Accumulate stats.
CHECK_EQ(0, offset);
stats->leaves_++;
@@ -524,13 +524,10 @@ static Handle<String> ConstructBalanced(
}
-static ConsStringIteratorOp cons_string_iterator_op_1;
-static ConsStringIteratorOp cons_string_iterator_op_2;
-
static void Traverse(Handle<String> s1, Handle<String> s2) {
int i = 0;
- StringCharacterStream character_stream_1(*s1, &cons_string_iterator_op_1);
- StringCharacterStream character_stream_2(*s2, &cons_string_iterator_op_2);
+ StringCharacterStream character_stream_1(*s1);
+ StringCharacterStream character_stream_2(*s2);
while (character_stream_1.HasMore()) {
CHECK(character_stream_2.HasMore());
uint16_t c = character_stream_1.GetNext();
@@ -546,8 +543,8 @@ static void Traverse(Handle<String> s1, Handle<String> s2) {
static void TraverseFirst(Handle<String> s1, Handle<String> s2, int chars) {
int i = 0;
- StringCharacterStream character_stream_1(*s1, &cons_string_iterator_op_1);
- StringCharacterStream character_stream_2(*s2, &cons_string_iterator_op_2);
+ StringCharacterStream character_stream_1(*s1);
+ StringCharacterStream character_stream_2(*s2);
while (character_stream_1.HasMore() && i < chars) {
CHECK(character_stream_2.HasMore());
uint16_t c = character_stream_1.GetNext();
@@ -616,10 +613,8 @@ static void VerifyCharacterStream(
if (offset < 0) offset = 0;
// Want to test the offset == length case.
if (offset > length) offset = length;
- StringCharacterStream flat_stream(
- flat_string, &cons_string_iterator_op_1, offset);
- StringCharacterStream cons_stream(
- cons_string, &cons_string_iterator_op_2, offset);
+ StringCharacterStream flat_stream(flat_string, offset);
+ StringCharacterStream cons_stream(cons_string, offset);
for (int i = offset; i < length; i++) {
uint16_t c = flat_string->Get(i);
CHECK(flat_stream.HasMore());
« no previous file with comments | « src/string-stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698