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

Unified Diff: lib/coreimpl/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/core/string.dart ('k') | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/coreimpl/collections.dart
diff --git a/lib/coreimpl/collections.dart b/lib/coreimpl/collections.dart
index 07f0abad47e1bd4005746a6a55f85522b184e4a5..55e76fadcf8719007af1ddd26dbdaee5068818bf 100644
--- a/lib/coreimpl/collections.dart
+++ b/lib/coreimpl/collections.dart
@@ -8,6 +8,13 @@
* method.
*/
class Collections {
+ static bool contains(Iterable iterable, var element) {
+ for (final e in iterable) {
+ if (element == e) return true;
+ }
+ return false;
+ }
+
static void forEach(Iterable iterable, void f(o)) {
for (final e in iterable) {
f(e);
« no previous file with comments | « lib/core/string.dart ('k') | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698