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

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

Issue 12401002: Make List.from and Iterable.toList default to not growable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/expando_patch.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) 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 patch class Int8List { 5 patch class Int8List {
6 /* patch */ factory Int8List(int length) { 6 /* patch */ factory Int8List(int length) {
7 return new _Int8Array(length); 7 return new _Int8Array(length);
8 } 8 }
9 9
10 /* patch */ factory Int8List.transferable(int length) { 10 /* patch */ factory Int8List.transferable(int length) {
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 ByteArray asByteArray([int start = 0, int length]) { 400 ByteArray asByteArray([int start = 0, int length]) {
401 if (length == null) { 401 if (length == null) {
402 length = this.length; 402 length = this.length;
403 } 403 }
404 _rangeCheck(this.length, start, length); 404 _rangeCheck(this.length, start, length);
405 return new _ByteArrayView(this, 405 return new _ByteArrayView(this,
406 start * this.bytesPerElement(), 406 start * this.bytesPerElement(),
407 length * this.bytesPerElement()); 407 length * this.bytesPerElement());
408 } 408 }
409 409
410 List<int> toList({ bool growable: false }) { 410 List<int> toList({ bool growable: true }) {
411 return new List<int>.from(this, growable: growable); 411 return new List<int>.from(this, growable: growable);
412 } 412 }
413 413
414 Set<int> toSet() { 414 Set<int> toSet() {
415 return new Set<int>.from(this); 415 return new Set<int>.from(this);
416 } 416 }
417 417
418 int _length() native "ByteArray_getLength"; 418 int _length() native "ByteArray_getLength";
419 419
420 void _setRange(int startInBytes, int lengthInBytes, 420 void _setRange(int startInBytes, int lengthInBytes,
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 ByteArray asByteArray([int start = 0, int length]) { 2703 ByteArray asByteArray([int start = 0, int length]) {
2704 if (length == null) { 2704 if (length == null) {
2705 length = this.lengthInBytes(); 2705 length = this.lengthInBytes();
2706 } 2706 }
2707 _rangeCheck(this.length, start, length); 2707 _rangeCheck(this.length, start, length);
2708 return _array.subByteArray(_offset + start, length); 2708 return _array.subByteArray(_offset + start, length);
2709 } 2709 }
2710 2710
2711 static const int _BYTES_PER_ELEMENT = 8; 2711 static const int _BYTES_PER_ELEMENT = 8;
2712 } 2712 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/expando_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698