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

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

Issue 11000025: Revert hiding of VM-only coreimpl list implementation types. While I (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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_patch.dart ('k') | runtime/lib/growable_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) 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.view(ByteArray array, 10 /* patch */ factory Int8List.view(ByteArray array,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Methods implementing the Collection interface. 124 // Methods implementing the Collection interface.
125 125
126 void forEach(void f(element)) { 126 void forEach(void f(element)) {
127 var len = this.length; 127 var len = this.length;
128 for (var i = 0; i < len; i++) { 128 for (var i = 0; i < len; i++) {
129 f(this[i]); 129 f(this[i]);
130 } 130 }
131 } 131 }
132 132
133 Collection map(f(element)) { 133 Collection map(f(element)) {
134 return Collections.map(this, new List(), f); 134 return Collections.map(this,
135 new GrowableObjectArray.withCapacity(length),
136 f);
135 } 137 }
136 138
137 Dynamic reduce(Dynamic initialValue, 139 Dynamic reduce(Dynamic initialValue,
138 Dynamic combine(Dynamic initialValue, element)) { 140 Dynamic combine(Dynamic initialValue, element)) {
139 return Collections.reduce(this, initialValue, combine); 141 return Collections.reduce(this, initialValue, combine);
140 } 142 }
141 143
142 Collection filter(bool f(element)) { 144 Collection filter(bool f(element)) {
143 return Collections.filter(this, new List(), f); 145 return Collections.filter(this, new GrowableObjectArray(), f);
144 } 146 }
145 147
146 bool every(bool f(element)) { 148 bool every(bool f(element)) {
147 return Collections.every(this, f); 149 return Collections.every(this, f);
148 } 150 }
149 151
150 bool some(bool f(element)) { 152 bool some(bool f(element)) {
151 return Collections.some(this, f); 153 return Collections.some(this, f);
152 } 154 }
153 155
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 // Methods implementing the Collection interface. 1603 // Methods implementing the Collection interface.
1602 1604
1603 void forEach(void f(element)) { 1605 void forEach(void f(element)) {
1604 var len = this.length; 1606 var len = this.length;
1605 for (var i = 0; i < len; i++) { 1607 for (var i = 0; i < len; i++) {
1606 f(this[i]); 1608 f(this[i]);
1607 } 1609 }
1608 } 1610 }
1609 1611
1610 Collection map(f(element)) { 1612 Collection map(f(element)) {
1611 return Collections.map(this, new List(), f); 1613 return Collections.map(this,
1614 new GrowableObjectArray.withCapacity(length),
1615 f);
1612 } 1616 }
1613 1617
1614 Dynamic reduce(Dynamic initialValue, 1618 Dynamic reduce(Dynamic initialValue,
1615 Dynamic combine(Dynamic initialValue, element)) { 1619 Dynamic combine(Dynamic initialValue, element)) {
1616 return Collections.reduce(this, initialValue, combine); 1620 return Collections.reduce(this, initialValue, combine);
1617 } 1621 }
1618 1622
1619 Collection filter(bool f(element)) { 1623 Collection filter(bool f(element)) {
1620 return Collections.filter(this, new List(), f); 1624 return Collections.filter(this, new GrowableObjectArray(), f);
1621 } 1625 }
1622 1626
1623 bool every(bool f(element)) { 1627 bool every(bool f(element)) {
1624 return Collections.every(this, f); 1628 return Collections.every(this, f);
1625 } 1629 }
1626 1630
1627 bool some(bool f(element)) { 1631 bool some(bool f(element)) {
1628 return Collections.some(this, f);; 1632 return Collections.some(this, f);;
1629 } 1633 }
1630 1634
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 } 2410 }
2407 _rangeCheck(this.length, start, length); 2411 _rangeCheck(this.length, start, length);
2408 return _array.subByteArray(_offset + start, length); 2412 return _array.subByteArray(_offset + start, length);
2409 } 2413 }
2410 2414
2411 static const int _BYTES_PER_ELEMENT = 8; 2415 static const int _BYTES_PER_ELEMENT = 8;
2412 final ByteArray _array; 2416 final ByteArray _array;
2413 final int _offset; 2417 final int _offset;
2414 final int _length; 2418 final int _length;
2415 } 2419 }
OLDNEW
« no previous file with comments | « runtime/lib/array_patch.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698