Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * This class is the public interface of a set. A set is a collection | 6 * This class is the public interface of a set. A set is a collection |
| 7 * without duplicates. | 7 * without duplicates. |
| 8 */ | 8 */ |
| 9 abstract class Set<E> extends Collection<E> { | 9 abstract class Set<E> extends Collection<E> { |
| 10 factory Set() => new _HashSetImpl<E>(); | 10 factory Set() => new _HashSetImpl<E>(); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 return res; | 227 return res; |
| 228 } | 228 } |
| 229 | 229 |
| 230 void _advance() { | 230 void _advance() { |
| 231 int length = _entries.length; | 231 int length = _entries.length; |
| 232 var entry; | 232 var entry; |
| 233 final deletedKey = _HashMapImpl._DELETED_KEY; | 233 final deletedKey = _HashMapImpl._DELETED_KEY; |
| 234 do { | 234 do { |
| 235 if (++_nextValidIndex >= length) break; | 235 if (++_nextValidIndex >= length) break; |
| 236 entry = _entries[_nextValidIndex]; | 236 entry = _entries[_nextValidIndex]; |
| 237 } while ((entry === null) || (entry === deletedKey)); | 237 } while ((entry == null) || (entry === deletedKey)); |
|
Lasse Reichstein Nielsen
2012/11/12 13:10:41
Convert other === too, to identical.
floitsch
2012/11/12 22:18:43
Done.
| |
| 238 } | 238 } |
| 239 | 239 |
| 240 // The entries in the set. May contain null or the sentinel value. | 240 // The entries in the set. May contain null or the sentinel value. |
| 241 List<E> _entries; | 241 List<E> _entries; |
| 242 | 242 |
| 243 // The next valid index in [_entries] or the length of [entries_]. | 243 // The next valid index in [_entries] or the length of [entries_]. |
| 244 // If it is the length of [_entries], calling [hasNext] on the | 244 // If it is the length of [_entries], calling [hasNext] on the |
| 245 // iterator will return false. | 245 // iterator will return false. |
| 246 int _nextValidIndex; | 246 int _nextValidIndex; |
| 247 } | 247 } |
| OLD | NEW |