From e984c55948f89afa7f741f983928d3716235c027 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 2 Mar 2016 15:31:08 -0800 Subject: [PATCH 1/2] use putIfAbsent return value --- lib/src/asset/cache.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/src/asset/cache.dart b/lib/src/asset/cache.dart index 89e4492ae..76e3fc2cb 100644 --- a/lib/src/asset/cache.dart +++ b/lib/src/asset/cache.dart @@ -60,12 +60,11 @@ class CachedAssetReader extends AssetReader { Future hasInput(AssetId id) { if (_cache.contains(id)) return new Future.value(true); - _pendingHasInputChecks.putIfAbsent(id, () async { + return _pendingHasInputChecks.putIfAbsent(id, () async { var exists = await _reader.hasInput(id); _pendingHasInputChecks.remove(id); return exists; }); - return _pendingHasInputChecks[id]; } @override @@ -74,13 +73,12 @@ class CachedAssetReader extends AssetReader { return new Future.value(_cache.get(id).stringContents); } - _pendingReads.putIfAbsent(id, () async { + return _pendingReads.putIfAbsent(id, () async { var content = await _reader.readAsString(id, encoding: encoding); _cache.put(new Asset(id, content)); _pendingReads.remove(id); return content; }); - return _pendingReads[id]; } @override From 46f99fb34fdbd0ff7bbd41deb1e8efe22e672e68 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 2 Mar 2016 15:34:14 -0800 Subject: [PATCH 2/2] disabling strong-mode until all errors are resolved --- .analysis_options | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.analysis_options b/.analysis_options index a10d4c5a0..c356fa678 100644 --- a/.analysis_options +++ b/.analysis_options @@ -1,2 +1,3 @@ analyzer: - strong-mode: true +# disabling strong-mode until all errors and warnings are resolved +# strong-mode: true