Index: runtime/vm/object.h |
diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
index 340a105de80b22d3850892145d23d70cace4d90e..adf29e5c3936eb103f229babbc00503f2de9da9f 100644 |
--- a/runtime/vm/object.h |
+++ b/runtime/vm/object.h |
@@ -3724,13 +3724,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_ != -1); |
siva
2012/11/30 02:00:19
why was this change necessary?
cshapiro
2012/11/30 02:28:22
It was a remnant of an intermediate edit. Reverte
|
+ ASSERT(index_ < end_); |
return ch_; |
} |
@@ -3738,8 +3748,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); |
}; |