Index: runtime/vm/object.h |
diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
index 5355fb1364f2b9989ed622fa22d5efd32b3b6fa1..721b83a5cd3f7394df11d04ecf565bdded92b674 100644 |
--- a/runtime/vm/object.h |
+++ b/runtime/vm/object.h |
@@ -3742,13 +3742,23 @@ class String : public Instance { |
public: |
explicit CodePointIterator(const String& str) |
: str_(str), |
+ ch_(0), |
index_(-1), |
- ch_(-1) { |
+ end_(str.Length()) { |
+ } |
+ |
+ CodePointIterator(const String& str, intptr_t start, intptr_t length) |
+ : str_(str), |
+ ch_(0), |
+ index_(start - 1), |
+ end_(start + length) { |
+ ASSERT(start >= 0); |
+ ASSERT(end_ <= str.Length()); |
} |
int32_t Current() { |
ASSERT(index_ >= 0); |
- ASSERT(index_ < str_.Length()); |
+ ASSERT(index_ < end_); |
return ch_; |
} |
@@ -3756,8 +3766,9 @@ class String : public Instance { |
private: |
const String& str_; |
- intptr_t index_; |
int32_t ch_; |
+ intptr_t index_; |
+ intptr_t end_; |
DISALLOW_IMPLICIT_CONSTRUCTORS(CodePointIterator); |
}; |