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

Unified Diff: tools/dom/src/CssClassSet.dart

Issue 13548002: Add Iterable.fold (and Stream.fold) which replace `reduce`. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
Index: tools/dom/src/CssClassSet.dart
diff --git a/tools/dom/src/CssClassSet.dart b/tools/dom/src/CssClassSet.dart
index 473c0370d1036b3ca20180d8d289e64fdf191dc3..29aa8602dd2cededcb19b7c9811b8aba4dd60994 100644
--- a/tools/dom/src/CssClassSet.dart
+++ b/tools/dom/src/CssClassSet.dart
@@ -62,6 +62,11 @@ abstract class CssClassSet implements Set<String> {
dynamic combine(dynamic previousValue, String element)) {
return readClasses().reduce(initialValue, combine);
Lasse Reichstein Nielsen 2013/04/04 08:35:18 call fold or readClasses().fold here.
floitsch 2013/04/05 16:10:03 Since we are in a 'reduce' I prefer to call to red
}
+
+ dynamic fold(dynamic initialValue,
+ dynamic combine(dynamic previousValue, String element)) {
+ return readClasses().fold(initialValue, combine);
+ }
// interface Collection - END
// interface Set - BEGIN

Powered by Google App Engine
This is Rietveld 408576698