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

Unified Diff: lib/src/utils.dart

Issue 2012113002: Use APIs from the latest collection package. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 7 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/runner/parse_metadata.dart ('k') | pubspec.yaml » ('j') | 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 0bbec87ee632025bf203f051cbf3bc3710df83e1..bc5a2701e9dbe16aff2b2c337f36061191cf9f71 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -192,38 +192,6 @@ List flatten(Iterable nested) {
return result;
}
-/// Creates a new map from [map] with new keys and values.
-///
-/// The return values of [keyFn] are used as the keys and the return values of
-/// [valueFn] are used as the values for the new map.
-Map/*<K2, V2>*/ mapMap/*<K1, V1, K2, V2>*/(Map/*<K1, V1>*/ map,
- {/*=K2*/ key(/*=K1*/ key, /*=V1*/ value),
- /*=V2*/ value(/*=K1*/ key, /*=V1*/ value)}) {
- key ??= (key, _) => key as dynamic/*=K2*/;
- value ??= (_, value) => value as dynamic/*=V2*/;
-
- return new Map.fromIterable(map.keys,
- key: (mapKey) => key(mapKey as dynamic/*=K1*/, map[mapKey]),
- value: (mapKey) => value(mapKey as dynamic/*=K1*/, map[mapKey]));
-}
-
-/// Returns a new map with all values in both [map1] and [map2].
-///
-/// If there are conflicting keys, [value] is used to merge them. If it's
-/// not passed, [map2]'s value wins.
-Map/*<K, V>*/ mergeMaps/*<K, V>*/(Map/*<K, V>*/ map1, Map/*<K, V>*/ map2,
- {/*=V*/ value(/*=V*/ value1, /*=V*/ value2)}) {
- var result = new Map/*<K, V>*/.from(map1);
- map2.forEach((key, mapValue) {
- if (value == null || !result.containsKey(key)) {
- result[key] = mapValue;
- } else {
- result[key] = value(result[key], mapValue);
- }
- });
- return result;
-}
-
/// Like [runZoned], but [zoneValues] are set for the callbacks in
/// [zoneSpecification] and [onError].
runZonedWithValues(body(), {Map zoneValues,
« no previous file with comments | « lib/src/runner/parse_metadata.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698