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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart

Issue 2666053004: Remove dynamic call from _LinkedHashSet. Remove some dcalls from the dart:html util library. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Patch file for dart:collection classes. 5 // Patch file for dart:collection classes.
6 import 'dart:_foreign_helper' show JS; 6 import 'dart:_foreign_helper' show JS;
7 import 'dart:_js_helper' show 7 import 'dart:_js_helper' show
8 fillLiteralMap, InternalMap, NoInline, NoSideEffects, NoThrows, patch, 8 fillLiteralMap, InternalMap, NoInline, NoSideEffects, NoThrows, patch,
9 JsLinkedHashMap, LinkedHashMapCell, LinkedHashMapKeyIterable, 9 JsLinkedHashMap, LinkedHashMapCell, LinkedHashMapKeyIterable,
10 LinkedHashMapKeyIterator; 10 LinkedHashMapKeyIterator;
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 E _element; 1599 E _element;
1600 1600
1601 _LinkedHashSetCell<E> _next; 1601 _LinkedHashSetCell<E> _next;
1602 _LinkedHashSetCell<E> _previous; 1602 _LinkedHashSetCell<E> _previous;
1603 1603
1604 _LinkedHashSetCell(this._element); 1604 _LinkedHashSetCell(this._element);
1605 } 1605 }
1606 1606
1607 // TODO(kasperl): Share this code with LinkedHashMapKeyIterator<E>? 1607 // TODO(kasperl): Share this code with LinkedHashMapKeyIterator<E>?
1608 class _LinkedHashSetIterator<E> implements Iterator<E> { 1608 class _LinkedHashSetIterator<E> implements Iterator<E> {
1609 final _set; 1609 final _LinkedHashSet _set;
1610 final int _modifications; 1610 final int _modifications;
1611 _LinkedHashSetCell _cell; 1611 _LinkedHashSetCell _cell;
1612 E _current; 1612 E _current;
1613 1613
1614 _LinkedHashSetIterator(this._set, this._modifications) { 1614 _LinkedHashSetIterator(this._set, this._modifications) {
1615 _cell = _set._first; 1615 _cell = _set._first;
1616 } 1616 }
1617 1617
1618 E get current => _current; 1618 E get current => _current;
1619 1619
1620 bool moveNext() { 1620 bool moveNext() {
1621 if (_modifications != _set._modifications) { 1621 if (_modifications != _set._modifications) {
1622 throw new ConcurrentModificationError(_set); 1622 throw new ConcurrentModificationError(_set);
1623 } else if (_cell == null) { 1623 } else if (_cell == null) {
1624 _current = null; 1624 _current = null;
1625 return false; 1625 return false;
1626 } else { 1626 } else {
1627 _current = _cell._element; 1627 _current = _cell._element;
1628 _cell = _cell._next; 1628 _cell = _cell._next;
1629 return true; 1629 return true;
1630 } 1630 }
1631 } 1631 }
1632 } 1632 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698