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

Unified Diff: pkg/serialization/lib/src/serialization_helpers.dart

Issue 12086062: Rename mappedBy to map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undo change to test-script. Created 7 years, 11 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 | « pkg/serialization/lib/src/reader_writer.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/serialization/lib/src/serialization_helpers.dart
diff --git a/pkg/serialization/lib/src/serialization_helpers.dart b/pkg/serialization/lib/src/serialization_helpers.dart
index a9954733e610a3594f5a25fc64b5b1d9e6e72d01..9568c24dee7db223fe32fb46df89a1c06c8d0da3 100644
--- a/pkg/serialization/lib/src/serialization_helpers.dart
+++ b/pkg/serialization/lib/src/serialization_helpers.dart
@@ -77,7 +77,7 @@ abstract class MapLikeIterable {
* [collection] is a List, it will be the same as the map() method if the
* [key] parameter wasn't passed.
*/
- mappedBy(Function f) {
+ map(Function f) {
var result = copyEmpty();
forEach((key, value) {
result[key] = f(key, value);
@@ -131,9 +131,9 @@ values(x) {
}
mapValues(x, f) {
- if (x is Set) return x.mappedBy(f).toSet();
- if (x is Iterable) return x.mappedBy(f).toList();
- if (x is Map) return new ListLikeIterable(x).mappedBy(f);
+ if (x is Set) return x.map(f).toSet();
+ if (x is Iterable) return x.map(f).toList();
+ if (x is Map) return new ListLikeIterable(x).map(f);
throw new ArgumentError("Invalid argument");
}
@@ -158,7 +158,7 @@ class ListLikeIterable {
* [collection] is a List, it will be the same as if map() had been called
* directly on [collection].
*/
- mappedBy(Function f) {
+ map(Function f) {
var result = new Map();
collection.forEach((key, value) => result[key] = f(value));
return result;
@@ -251,4 +251,4 @@ class IdentityMap<K, V> implements Map<K, V> {
// Note that this is doing an equality comparison.
bool containsValue(x) => values.contains(x);
-}
+}
« no previous file with comments | « pkg/serialization/lib/src/reader_writer.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698