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

Side by Side Diff: sdk/lib/collection/hash_set.dart

Issue 297053002: Reinstall previous behavior for Set and Queue toString. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/lib/js_array.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.collection; 5 part of dart.collection;
6 6
7 /** Common parts of [HashSet] and [LinkedHashSet] implementations. */ 7 /** Common parts of [HashSet] and [LinkedHashSet] implementations. */
8 abstract class _HashSetBase<E> extends SetBase<E> { 8 abstract class _HashSetBase<E> extends SetBase<E> {
9 9
10 // The following two methods override the ones in SetBase. 10 // The following two methods override the ones in SetBase.
(...skipping 13 matching lines...) Expand all
24 for (var element in this) { 24 for (var element in this) {
25 if (other.contains(element)) result.add(element); 25 if (other.contains(element)) result.add(element);
26 } 26 }
27 return result; 27 return result;
28 } 28 }
29 29
30 Set<E> _newSet(); 30 Set<E> _newSet();
31 31
32 // Subclasses can optimize this further. 32 // Subclasses can optimize this further.
33 Set<E> toSet() => _newSet()..addAll(this); 33 Set<E> toSet() => _newSet()..addAll(this);
34
35 String toString() => _setToString(this);
36 } 34 }
37 35
38 /** 36 /**
39 * An unordered hash-table based [Set] implementation. 37 * An unordered hash-table based [Set] implementation.
40 * 38 *
41 * The elements of a `HashSet` must have consistent equality 39 * The elements of a `HashSet` must have consistent equality
42 * and hashCode implementations. This means that the equals operation 40 * and hashCode implementations. This means that the equals operation
43 * must define a stable equivalence relation on the elements (reflexive, 41 * must define a stable equivalence relation on the elements (reflexive,
44 * anti-symmetric, transitive, and consistent over time), and that the hashCode 42 * anti-symmetric, transitive, and consistent over time), and that the hashCode
45 * must consistent with equality, so that the same for objects that are 43 * must consistent with equality, so that the same for objects that are
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 95 }
98 96
99 /** 97 /**
100 * Provides an iterator that iterates over the elements of this set. 98 * Provides an iterator that iterates over the elements of this set.
101 * 99 *
102 * The order of iteration is unspecified, 100 * The order of iteration is unspecified,
103 * but consistent between changes to the set. 101 * but consistent between changes to the set.
104 */ 102 */
105 Iterator<E> get iterator; 103 Iterator<E> get iterator;
106 } 104 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/js_array.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698