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

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

Issue 12086062: Rename mappedBy to map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 bool contains(element) => IterableMixinWorkaround.contains(this, element); 223 bool contains(element) => IterableMixinWorkaround.contains(this, element);
224 224
225 void forEach(void f(element)) { 225 void forEach(void f(element)) {
226 var len = this.length; 226 var len = this.length;
227 for (var i = 0; i < len; i++) { 227 for (var i = 0; i < len; i++) {
228 f(this[i]); 228 f(this[i]);
229 } 229 }
230 } 230 }
231 231
232 List mappedBy(f(int element)) { 232 Iterable map(f(int element)) {
floitsch 2013/01/30 14:48:44 map should already return an Iterable.
Lasse Reichstein Nielsen 2013/01/31 11:33:49 Now returns a non-List iterable.
233 return IterableMixinWorkaround.mappedByList(this, f); 233 return IterableMixinWorkaround.mappedByList(this, f);
234 } 234 }
235 235
236 Iterable mappedBy(f(int element)) => map(f);
237
236 String join([String separator]) { 238 String join([String separator]) {
237 return IterableMixinWorkaround.join(this, separator); 239 return IterableMixinWorkaround.join(this, separator);
238 } 240 }
239 241
240 dynamic reduce(dynamic initialValue, 242 dynamic reduce(dynamic initialValue,
241 dynamic combine(dynamic initialValue, element)) { 243 dynamic combine(dynamic initialValue, element)) {
242 return IterableMixinWorkaround.reduce(this, initialValue, combine); 244 return IterableMixinWorkaround.reduce(this, initialValue, combine);
243 } 245 }
244 246
245 Collection where(bool f(element)) { 247 Collection where(bool f(element)) {
246 return IterableMixinWorkaround.where(this, f); 248 return IterableMixinWorkaround.where(this, f);
247 } 249 }
248 250
249 List<int> take(int n) { 251 Iterable<int> take(int n) {
250 return IterableMixinWorkaround.takeList(this, n); 252 return IterableMixinWorkaround.takeList(this, n);
251 } 253 }
252 254
253 Iterable<int> takeWhile(bool test(int value)) { 255 Iterable<int> takeWhile(bool test(int value)) {
254 return IterableMixinWorkaround.takeWhile(this, test); 256 return IterableMixinWorkaround.takeWhile(this, test);
255 } 257 }
256 258
257 List<int> skip(int n) { 259 Iterable<int> skip(int n) {
258 return IterableMixinWorkaround.skipList(this, n); 260 return IterableMixinWorkaround.skipList(this, n);
259 } 261 }
260 262
261 Iterable<int> skipWhile(bool test(int value)) { 263 Iterable<int> skipWhile(bool test(int value)) {
262 return IterableMixinWorkaround.skipWhile(this, test); 264 return IterableMixinWorkaround.skipWhile(this, test);
263 } 265 }
264 266
265 bool every(bool f(element)) { 267 bool every(bool f(element)) {
266 return IterableMixinWorkaround.every(this, f); 268 return IterableMixinWorkaround.every(this, f);
267 } 269 }
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 ByteArray asByteArray([int start = 0, int length]) { 2671 ByteArray asByteArray([int start = 0, int length]) {
2670 if (length == null) { 2672 if (length == null) {
2671 length = this.lengthInBytes(); 2673 length = this.lengthInBytes();
2672 } 2674 }
2673 _rangeCheck(this.length, start, length); 2675 _rangeCheck(this.length, start, length);
2674 return _array.subByteArray(_offset + start, length); 2676 return _array.subByteArray(_offset + start, length);
2675 } 2677 }
2676 2678
2677 static const int _BYTES_PER_ELEMENT = 8; 2679 static const int _BYTES_PER_ELEMENT = 8;
2678 } 2680 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698