| Index: third_party/pkg/route_hierarchical/lib/src/async_utils.dart
|
| diff --git a/third_party/pkg/route_hierarchical/lib/src/async_utils.dart b/third_party/pkg/route_hierarchical/lib/src/async_utils.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c12365fe9888edfca772fd2ce9000e13564f2891
|
| --- /dev/null
|
| +++ b/third_party/pkg/route_hierarchical/lib/src/async_utils.dart
|
| @@ -0,0 +1,18 @@
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library route.async_utils;
|
| +
|
| +import 'dart:async';
|
| +
|
| +Future doWhile(Iterable iterable, Future<bool> action(i)) =>
|
| + _doWhile(iterable.iterator, action);
|
| +
|
| +Future _doWhile(Iterator iterator, Future<bool> action(i)) =>
|
| + (iterator.moveNext())
|
| + ? action(iterator.current).then((bool result) =>
|
| + (result)
|
| + ? _doWhile(iterator, action)
|
| + : new Future.value(false))
|
| + : new Future.value(false);
|
|
|