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

Unified Diff: samples/swarm/DataSource.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « samples/spirodraw/Spirodraw.dart ('k') | samples/swarm/UIState.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/swarm/DataSource.dart
diff --git a/samples/swarm/DataSource.dart b/samples/swarm/DataSource.dart
index 0a7e51fff4454891b2058eeda9a4d7115096d5c0..8c7d0e82fe8c2af76a5d3f4d7f5a926ce74588d9 100644
--- a/samples/swarm/DataSource.dart
+++ b/samples/swarm/DataSource.dart
@@ -6,7 +6,7 @@ part of swarmlib;
/** The top-level collection of all sections for a user. */
// TODO(jimhug): This is known as UserData in the server model.
-class Sections implements Collection<Section> {
+class Sections extends Collection<Section> {
final List<Section> _sections;
Sections(this._sections);
@@ -16,7 +16,7 @@ class Sections implements Collection<Section> {
int get length => _sections.length;
List<String> get sectionTitles =>
- CollectionUtils.map(_sections, (s) => s.title);
+ _sections.mappedBy((s) => s.title).toList();
void refresh() {
// TODO(jimhug): http://b/issue?id=5351067
@@ -31,7 +31,7 @@ class Sections implements Collection<Section> {
}
// TODO(jimhug): Track down callers!
- Iterator<Section> iterator() => _sections.iterator();
+ Iterator<Section> get iterator => _sections.iterator;
// TODO(jimhug): Better support for switching between local dev and server.
static bool get runningFromFile {
@@ -89,15 +89,8 @@ class Sections implements Collection<Section> {
List<Section> get sections => _sections;
// Collection<Section> methods:
- List map(f(Section element)) {
- return Collections.map(this, new List(), f);
- }
-
- List<Section> filter(bool f(Section element)) {
- return Collections.filter(this, new List<Section>(), f);
- }
bool every(bool f(Section element)) => Collections.every(this, f);
- bool some(bool f(Section element)) => Collections.some(this, f);
+ bool any(bool f(Section element)) => Collections.any(this, f);
void forEach(void f(Section element)) { Collections.forEach(this, f); }
// TODO(jmesserly): this should be a property
« no previous file with comments | « samples/spirodraw/Spirodraw.dart ('k') | samples/swarm/UIState.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698