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

Unified Diff: test/generated_sdk/lib/collection/hash_set.dart

Issue 959913003: cleanup patch generation to preseve comments and remove @patch (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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: test/generated_sdk/lib/collection/hash_set.dart
diff --git a/test/generated_sdk/lib/collection/hash_set.dart b/test/generated_sdk/lib/collection/hash_set.dart
index ed645e6058dcd64949abe6b02c0fe94585248971..2a84cad4975b00a69a7892c6eb4883edba3a4033 100644
--- a/test/generated_sdk/lib/collection/hash_set.dart
+++ b/test/generated_sdk/lib/collection/hash_set.dart
@@ -50,7 +50,27 @@ abstract class _HashSetBase<E> extends SetBase<E> {
* codes of objects are well distributed.
*/
abstract class HashSet<E> implements Set<E> {
- @patch
+ /**
+ * Create a hash set using the provided [equals] as equality.
+ *
+ * The provided [equals] must define a stable equivalence relation, and
+ * [hashCode] must be consistent with [equals]. If the [equals] or [hashCode]
+ * methods won't work on all objects, but only to instances of E, the
+ * [isValidKey] predicate can be used to restrict the keys that they are
+ * applied to. Any key for which [isValidKey] returns false is automatically
+ * assumed to not be in the set.
+ *
+ * If [equals] or [hashCode] are omitted, the set uses
+ * the objects' intrinsic [Object.operator==] and [Object.hashCode].
+ *
+ * If [isValidKey] is omitted, it defaults to testing if the object is an
+ * [E] instance.
+ *
+ * If you supply one of [equals] and [hashCode],
+ * you should generally also to supply the other.
+ * An example would be using [identical] and [identityHashCode],
+ * which is equivalent to using the shorthand [LinkedSet.identity]).
+ */
factory HashSet({ bool equals(E e1, E e2),
int hashCode(E e),
bool isValidKey(potentialKey) }) {
@@ -80,7 +100,13 @@ abstract class HashSet<E> implements Set<E> {
return new _CustomHashSet<E>(equals, hashCode, isValidKey);
}
- @patch
+ /**
+ * Creates an unordered identity-based set.
+ *
+ * Effectively a shorthand for:
+ *
+ * new HashSet(equals: identical, hashCode: identityHashCodeOf)
+ */
factory HashSet.identity() = _IdentityHashSet<E>;
/**
« no previous file with comments | « test/generated_sdk/lib/collection/hash_map.dart ('k') | test/generated_sdk/lib/collection/linked_hash_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698