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

Unified Diff: sdk/lib/internal/iterable.dart

Issue 2754013002: Format all dart: library files (Closed)
Patch Set: Format all dart: library files Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | sdk/lib/internal/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/internal/iterable.dart
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index 73fa5bca2f3f37252a7a0201aca258ad6601766e..843b5d58e8b92f017842263a570fdc81eef4e213 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -94,7 +94,7 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
return false;
}
- E firstWhere(bool test(E element), { E orElse() }) {
+ E firstWhere(bool test(E element), {E orElse()}) {
int length = this.length;
for (int i = 0; i < length; i++) {
E element = elementAt(i);
@@ -107,7 +107,7 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
throw IterableElementError.noElement();
}
- E lastWhere(bool test(E element), { E orElse() }) {
+ E lastWhere(bool test(E element), {E orElse()}) {
int length = this.length;
for (int i = length - 1; i >= 0; i--) {
E element = elementAt(i);
@@ -183,7 +183,6 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
if (length != this.length) {
throw new ConcurrentModificationError(this);
}
-
}
return value;
}
@@ -208,7 +207,7 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
Iterable<E> takeWhile(bool test(E element)) => super.takeWhile(test);
- List<E> toList({ bool growable: true }) {
+ List<E> toList({bool growable: true}) {
List<E> result;
if (growable) {
result = new List<E>()..length = length;
@@ -231,7 +230,7 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
}
class SubListIterable<E> extends ListIterable<E> {
- final Iterable<E> _iterable; // Has efficient length and elementAt.
+ final Iterable<E> _iterable; // Has efficient length and elementAt.
final int _start;
/** If null, represents the length of the iterable. */
final int _endOrLength;
@@ -301,8 +300,8 @@ class SubListIterable<E> extends ListIterable<E> {
if (_endOrLength != null && _endOrLength < end) end = _endOrLength;
int length = end - start;
if (length < 0) length = 0;
- List<E> result = growable ? (new List<E>()..length = length)
- : new List<E>(length);
+ List<E> result =
+ growable ? (new List<E>()..length = length) : new List<E>(length);
for (int i = 0; i < length; i++) {
result[i] = _iterable.elementAt(start + i);
if (_iterable.length < end) throw new ConcurrentModificationError(this);
@@ -325,7 +324,9 @@ class ListIterator<E> implements Iterator<E> {
E _current;
ListIterator(Iterable<E> iterable)
- : _iterable = iterable, _length = iterable.length, _index = 0;
+ : _iterable = iterable,
+ _length = iterable.length,
+ _index = 0;
E get current => _current;
@@ -412,7 +413,6 @@ class MappedListIterable<S, T> extends ListIterable<T> {
T elementAt(int index) => _f(_source.elementAt(index));
}
-
typedef bool _ElementPredicate<E>(E element);
class WhereIterable<E> extends Iterable<E> {
@@ -509,7 +509,7 @@ class TakeIterable<E> extends Iterable<E> {
}
class EfficientLengthTakeIterable<E> extends TakeIterable<E>
- implements EfficientLengthIterable<E> {
+ implements EfficientLengthIterable<E> {
EfficientLengthTakeIterable(Iterable<E> iterable, int takeCount)
: super._(iterable, takeCount);
@@ -520,7 +520,6 @@ class EfficientLengthTakeIterable<E> extends TakeIterable<E>
}
}
-
class TakeIterator<E> extends Iterator<E> {
final Iterator<E> _iterator;
int _remaining;
@@ -609,7 +608,7 @@ class SkipIterable<E> extends Iterable<E> {
}
class EfficientLengthSkipIterable<E> extends SkipIterable<E>
- implements EfficientLengthIterable<E> {
+ implements EfficientLengthIterable<E> {
EfficientLengthSkipIterable(Iterable<E> iterable, int skipCount)
: super._(iterable, skipCount);
@@ -682,13 +681,21 @@ class EmptyIterable<E> extends EfficientLengthIterable<E> {
int get length => 0;
- E get first { throw IterableElementError.noElement(); }
+ E get first {
+ throw IterableElementError.noElement();
+ }
- E get last { throw IterableElementError.noElement(); }
+ E get last {
+ throw IterableElementError.noElement();
+ }
- E get single { throw IterableElementError.noElement(); }
+ E get single {
+ throw IterableElementError.noElement();
+ }
- E elementAt(int index) { throw new RangeError.range(index, 0, 0, "index"); }
+ E elementAt(int index) {
+ throw new RangeError.range(index, 0, 0, "index");
+ }
bool contains(Object element) => false;
@@ -696,17 +703,17 @@ class EmptyIterable<E> extends EfficientLengthIterable<E> {
bool any(bool test(E element)) => false;
- E firstWhere(bool test(E element), { E orElse() }) {
+ E firstWhere(bool test(E element), {E orElse()}) {
if (orElse != null) return orElse();
throw IterableElementError.noElement();
}
- E lastWhere(bool test(E element), { E orElse() }) {
+ E lastWhere(bool test(E element), {E orElse()}) {
if (orElse != null) return orElse();
throw IterableElementError.noElement();
}
- E singleWhere(bool test(E element), { E orElse() }) {
+ E singleWhere(bool test(E element), {E orElse()}) {
if (orElse != null) return orElse();
throw IterableElementError.noElement();
}
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | sdk/lib/internal/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698