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

Unified Diff: sdk/lib/core/iterable.dart

Issue 288103003: Change Set.toSet to always return a set with the same behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update html5lib pubspec version to 0.12.0-dev Created 6 years, 7 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: sdk/lib/core/iterable.dart
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index 7d0ff160c9f3647831f773ca9058c11d14aee955..f9d3a3f5ed66880912c2b6a78d1b3273b20a8e06 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -95,6 +95,13 @@ abstract class Iterable<E> {
/**
* Returns true if the collection contains an element equal to [element].
+ *
+ * The equality used to determine wheter [element] is equal to an element of
+ * the iterable, depends on the type of iterable.
+ * For example, a [Set] may have a custom equality
+ * (see, e.g., [Set.identical]) that its `contains` uses.
+ * Likewise the `Iterable` returned by a [Map.keys] call
+ * will likely use the same equality that the `Map` uses for keys.
*/
bool contains(Object element);
@@ -164,7 +171,13 @@ abstract class Iterable<E> {
List<E> toList({ bool growable: true });
/**
- * Creates a [Set] containing the elements of this [Iterable].
+ * Creates a [Set] containing the same elements as this iterable.
+ *
+ * The returned `Set` will have the same `Set.length`
+ * as the `length` of this iterable,
+ * and its `Set.contains` will return the same result
+ * as the `contains` of this iterable.
+ * The order of the elements may be different.
*/
Set<E> toSet();

Powered by Google App Engine
This is Rietveld 408576698