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

Unified Diff: lib/html/src/_Collections.dart

Issue 11169004: Add "contains" method to Collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed last illegal-access Created 8 years, 2 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/html/src/Isolates.dart ('k') | lib/html/src/_Lists.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/src/_Collections.dart
diff --git a/lib/html/src/_Collections.dart b/lib/html/src/_Collections.dart
index 785e669fd2a927b99190edfc782d6ea6bee55d7b..9096fc6b2dcc2f80a244840103dbf0bf117385ff 100644
--- a/lib/html/src/_Collections.dart
+++ b/lib/html/src/_Collections.dart
@@ -8,6 +8,13 @@
* method.
*/
class _Collections {
+ static bool contains(Iterable<Object> iterable, Object element) {
+ for (final e in iterable) {
+ if (e == element) return true;
+ }
+ return false;
+ }
+
static void forEach(Iterable<Object> iterable, void f(Object o)) {
for (final e in iterable) {
f(e);
« no previous file with comments | « lib/html/src/Isolates.dart ('k') | lib/html/src/_Lists.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698