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

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
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/object.cc » ('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) 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 factory _GrowableObjectArray._uninstantiable() { 6 static final int _classId = (new _GrowableObjectArray(0))._cid;
7 throw new UnsupportedError(
8 "GrowableObjectArray can only be allocated by the VM");
9 }
10 7
11 void insert(int index, T element) { 8 void insert(int index, T element) {
12 if (index < 0 || index > length) { 9 if (index < 0 || index > length) {
13 throw new RangeError.range(index, 0, length); 10 throw new RangeError.range(index, 0, length);
14 } 11 }
15 if (index == this.length) { 12 if (index == this.length) {
16 add(element); 13 add(element);
17 return; 14 return;
18 } 15 }
19 int oldLength = this.length; 16 int oldLength = this.length;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 347 }
351 348
352 Set<T> toSet() { 349 Set<T> toSet() {
353 return new Set<T>.from(this); 350 return new Set<T>.from(this);
354 } 351 }
355 352
356 Map<int, T> asMap() { 353 Map<int, T> asMap() {
357 return IterableMixinWorkaround.asMapList(this); 354 return IterableMixinWorkaround.asMapList(this);
358 } 355 }
359 } 356 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698