| Index: sdk/lib/collection/set.dart
|
| diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart
|
| index 806aa809bc5e8412bb6d413eaafeb0f541433e94..7776655f3e5c0ef42777b6b170e2b986b1902027 100644
|
| --- a/sdk/lib/collection/set.dart
|
| +++ b/sdk/lib/collection/set.dart
|
| @@ -113,15 +113,15 @@ abstract class SetMixin<E> implements Set<E> {
|
| }
|
|
|
| List<E> toList({bool growable: true}) {
|
| - 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);
|
| int i = 0;
|
| for (E element in this) result[i++] = element;
|
| return result;
|
| }
|
|
|
| - Iterable<T> map<T>(T f(E element)) =>
|
| - new EfficientLengthMappedIterable<E, T>(this, f);
|
| + Iterable<T> map<T>(T f(E element)) => new EfficientLengthMappedIterable<E, T>(
|
| + this, f);
|
|
|
| E get single {
|
| if (length > 1) throw IterableElementError.tooMany();
|
| @@ -138,8 +138,8 @@ abstract class SetMixin<E> implements Set<E> {
|
|
|
| Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f);
|
|
|
| - Iterable<T> expand<T>(Iterable<T> f(E element)) =>
|
| - new ExpandIterable<E, T>(this, f);
|
| + Iterable<T>
|
| + expand<T>(Iterable<T> f(E element)) => new ExpandIterable<E, T>(this, f);
|
|
|
| void forEach(void f(E element)) {
|
| for (E element in this) f(element);
|
| @@ -157,8 +157,7 @@ abstract class SetMixin<E> implements Set<E> {
|
| return value;
|
| }
|
|
|
| - T fold<T>(T initialValue,
|
| - T combine(T previousValue, E element)) {
|
| + T fold<T>(T initialValue, T combine(T previousValue, E element)) {
|
| var value = initialValue;
|
| for (E element in this) value = combine(value, element);
|
| return value;
|
| @@ -228,11 +227,11 @@ abstract class SetMixin<E> implements Set<E> {
|
| E result;
|
| do {
|
| result = it.current;
|
| - } while(it.moveNext());
|
| + } while (it.moveNext());
|
| return result;
|
| }
|
|
|
| - E firstWhere(bool test(E value), { E orElse() }) {
|
| + E firstWhere(bool test(E value), {E orElse()}) {
|
| for (E element in this) {
|
| if (test(element)) return element;
|
| }
|
| @@ -240,7 +239,7 @@ abstract class SetMixin<E> implements Set<E> {
|
| throw IterableElementError.noElement();
|
| }
|
|
|
| - E lastWhere(bool test(E value), { E orElse() }) {
|
| + E lastWhere(bool test(E value), {E orElse()}) {
|
| E result = null;
|
| bool foundMatching = false;
|
| for (E element in this) {
|
|
|