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

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/collection_patch.dart

Issue 1154263003: Revert "Make EfficientLength public, as EfficientLengthIterable." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | sdk/lib/_internal/compiler/js_lib/js_array.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 for (int i = 0; i < length; i += 2) { 423 for (int i = 0; i < length; i += 2) {
424 if (_equals(JS('var', '#[#]', bucket, i), key)) return i; 424 if (_equals(JS('var', '#[#]', bucket, i), key)) return i;
425 } 425 }
426 return -1; 426 return -1;
427 } 427 }
428 428
429 String toString() => Maps.mapToString(this); 429 String toString() => Maps.mapToString(this);
430 } 430 }
431 431
432 class HashMapKeyIterable<E> extends Iterable<E> 432 class HashMapKeyIterable<E> extends Iterable<E>
433 implements EfficientLengthIterable<E> { 433 implements EfficientLength {
434 final _map; 434 final _map;
435 HashMapKeyIterable(this._map); 435 HashMapKeyIterable(this._map);
436 436
437 int get length => _map._length; 437 int get length => _map._length;
438 bool get isEmpty => _map._length == 0; 438 bool get isEmpty => _map._length == 0;
439 439
440 Iterator<E> get iterator { 440 Iterator<E> get iterator {
441 return new HashMapKeyIterator<E>(_map, _map._computeKeys()); 441 return new HashMapKeyIterator<E>(_map, _map._computeKeys());
442 } 442 }
443 443
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 } else if (_cell == null) { 1474 } else if (_cell == null) {
1475 _current = null; 1475 _current = null;
1476 return false; 1476 return false;
1477 } else { 1477 } else {
1478 _current = _cell._element; 1478 _current = _cell._element;
1479 _cell = _cell._next; 1479 _cell = _cell._next;
1480 return true; 1480 return true;
1481 } 1481 }
1482 } 1482 }
1483 } 1483 }
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | sdk/lib/_internal/compiler/js_lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698