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

Unified Diff: lib/src/utils.dart

Issue 2256623003: Fix more strong mode errors and warnings. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 4 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 | « lib/src/io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 2bead98e47458e926c7cfae2970b725fba986bba..f203ad520ac5fc3291bb5583410ce83577441ad9 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -630,17 +630,13 @@ Future/*<T>*/ awaitObject/*<T>*/(/*=T*/ object) async {
if (object is Future) return await awaitObject(await object);
if (object is Iterable) {
- // TODO(nweiz): Remove the unnecessary as check when sdk#26965 is fixed.
- return await Future.wait((object as Iterable).map(awaitObject))
- as List/*=T*/;
+ return await Future.wait(object.map(awaitObject)) as List/*=T*/;
}
if (object is Map) {
- // TODO(nweiz): Remove the unnecessary as check when sdk#26965 is fixed.
- var oldMap = object as Map;
var newMap = {};
- await Future.wait(oldMap.keys.map((key) async {
- newMap[key] = await awaitObject(await oldMap[key]);
+ await Future.wait(object.keys.map((key) async {
+ newMap[key] = await awaitObject(await object[key]);
}));
return newMap as Map/*=T*/;
}
« no previous file with comments | « lib/src/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698