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

Unified Diff: corelib/src/implementation/hash_map_set.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 | « corelib/src/collection.dart ('k') | corelib/src/implementation/queue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/implementation/hash_map_set.dart
===================================================================
--- corelib/src/implementation/hash_map_set.dart (revision 3161)
+++ corelib/src/implementation/hash_map_set.dart (working copy)
@@ -336,6 +336,14 @@
});
}
+ Set map(f(E element)) {
+ Set result = new Set();
+ _backingMap.forEach(void _(E key, E value) {
+ result.add(f(key));
+ });
+ return result;
+ }
+
Set<E> filter(bool f(E element)) {
Set<E> result = new Set<E>();
_backingMap.forEach(void _(E key, E value) {
« no previous file with comments | « corelib/src/collection.dart ('k') | corelib/src/implementation/queue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698