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

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

Issue 12188011: Added expand method to iterables. (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
« no previous file with comments | « runtime/lib/array.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.transferable(int length) { 10 /* patch */ factory Int8List.transferable(int length) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 String join([String separator]) { 240 String join([String separator]) {
241 return IterableMixinWorkaround.join(this, separator); 241 return IterableMixinWorkaround.join(this, separator);
242 } 242 }
243 243
244 dynamic reduce(dynamic initialValue, 244 dynamic reduce(dynamic initialValue,
245 dynamic combine(dynamic initialValue, element)) { 245 dynamic combine(dynamic initialValue, element)) {
246 return IterableMixinWorkaround.reduce(this, initialValue, combine); 246 return IterableMixinWorkaround.reduce(this, initialValue, combine);
247 } 247 }
248 248
249 Collection where(bool f(element)) { 249 Collection where(bool f(int element)) {
250 return IterableMixinWorkaround.where(this, f); 250 return IterableMixinWorkaround.where(this, f);
251 } 251 }
252 252
253 Iterable expand(Iterable f(int element)) {
254 return IterableMixinWorkaround.expand(this, f);
255 }
256
253 Iterable<int> take(int n) { 257 Iterable<int> take(int n) {
254 return IterableMixinWorkaround.takeList(this, n); 258 return IterableMixinWorkaround.takeList(this, n);
255 } 259 }
256 260
257 Iterable<int> takeWhile(bool test(int value)) { 261 Iterable<int> takeWhile(bool test(int value)) {
258 return IterableMixinWorkaround.takeWhile(this, test); 262 return IterableMixinWorkaround.takeWhile(this, test);
259 } 263 }
260 264
261 Iterable<int> skip(int n) { 265 Iterable<int> skip(int n) {
262 return IterableMixinWorkaround.skipList(this, n); 266 return IterableMixinWorkaround.skipList(this, n);
(...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 ByteArray asByteArray([int start = 0, int length]) { 2677 ByteArray asByteArray([int start = 0, int length]) {
2674 if (length == null) { 2678 if (length == null) {
2675 length = this.lengthInBytes(); 2679 length = this.lengthInBytes();
2676 } 2680 }
2677 _rangeCheck(this.length, start, length); 2681 _rangeCheck(this.length, start, length);
2678 return _array.subByteArray(_offset + start, length); 2682 return _array.subByteArray(_offset + start, length);
2679 } 2683 }
2680 2684
2681 static const int _BYTES_PER_ELEMENT = 8; 2685 static const int _BYTES_PER_ELEMENT = 8;
2682 } 2686 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698