Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 9118) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -4692,6 +4692,32 @@ |
| } |
| +LibraryPrefixIterator::LibraryPrefixIterator(const Library& library) |
| + : DictionaryIterator(library) { |
| + MoveToNext(); |
|
siva
2012/06/26 18:46:28
Your suggestion of 'Advance' in another context se
|
| +} |
| + |
| + |
| +RawLibraryPrefix* LibraryPrefixIterator::GetNext() { |
| + ASSERT(HasNext()); |
| + int ix = next_ix_++; |
| + Object& obj = Object::Handle(array_.At(ix)); |
| + MoveToNext(); |
| + LibraryPrefix& prefix = LibraryPrefix::Handle(); |
| + prefix ^= obj.raw(); |
| + return prefix.raw(); |
| +} |
| + |
| + |
| +void LibraryPrefixIterator::MoveToNext() { |
| + Object& obj = Object::Handle(array_.At(next_ix_)); |
| + while (!obj.IsLibraryPrefix() && HasNext()) { |
| + next_ix_++; |
| + obj = array_.At(next_ix_); |
| + } |
| +} |
| + |
| + |
| void Library::SetName(const String& name) const { |
| // Only set name once. |
| ASSERT(!Loaded()); |