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

Side by Side Diff: runtime/lib/growable_array.dart

Issue 14703005: Added Object._cid getter, optimized it. Added to (some) classes a static final _clCid. Use those to… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class _GrowableObjectArray<T> implements List<T> { 5 class _GrowableObjectArray<T> implements List<T> {
6 static final int _clCid = []._cid;
Ivan Posva 2013/05/13 22:12:37 Same problem about relying on the default List con
srdjan 2013/05/14 17:46:31 Done.
7
6 factory _GrowableObjectArray._uninstantiable() { 8 factory _GrowableObjectArray._uninstantiable() {
Ivan Posva 2013/05/13 22:12:37 Of topic: Is this constructor still needed here?
srdjan 2013/05/14 17:46:31 Removed
7 throw new UnsupportedError( 9 throw new UnsupportedError(
8 "GrowableObjectArray can only be allocated by the VM"); 10 "GrowableObjectArray can only be allocated by the VM");
9 } 11 }
10 12
11 void insert(int index, T element) { 13 void insert(int index, T element) {
12 if (index < 0 || index > length) { 14 if (index < 0 || index > length) {
13 throw new RangeError.range(index, 0, length); 15 throw new RangeError.range(index, 0, length);
14 } 16 }
15 if (index == this.length) { 17 if (index == this.length) {
16 add(element); 18 add(element);
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 352 }
351 353
352 Set<T> toSet() { 354 Set<T> toSet() {
353 return new Set<T>.from(this); 355 return new Set<T>.from(this);
354 } 356 }
355 357
356 Map<int, T> asMap() { 358 Map<int, T> asMap() {
357 return IterableMixinWorkaround.asMapList(this); 359 return IterableMixinWorkaround.asMapList(this);
358 } 360 }
359 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698