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

Unified Diff: sdk/lib/collection/linked_list.dart

Issue 18837002: Move toString() to collection classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/collection/linked_list.dart
diff --git a/sdk/lib/collection/linked_list.dart b/sdk/lib/collection/linked_list.dart
index a9c898969429e27cbe854b7cf577c6acfb06c7bc..19817f3875d424e3f5b6f76a0d032b50189612c2 100644
--- a/sdk/lib/collection/linked_list.dart
+++ b/sdk/lib/collection/linked_list.dart
@@ -14,6 +14,8 @@ part of dart.collection;
class LinkedList<E extends LinkedListEntry<E>>
extends IterableBase<E>
implements _LinkedListLink {
+ static List _toStringList = new List();
+
int _modificationCount = 0;
int _length = 0;
_LinkedListLink _next;
@@ -60,7 +62,16 @@ class LinkedList<E extends LinkedListEntry<E>>
Iterator<E> get iterator => new _LinkedListIterator<E>(this);
- String toString() => ToString.iterableToString(this);
+ String toString() {
+ for(int i = 0; i < _toStringList.length; i++) {
floitsch 2013/07/08 12:00:50 Simple call to IterableMixinWorkaround. Add TODO t
zarah 2013/07/08 14:35:15 Done.
+ if(identical(_toStringList[i], this))
+ return '{...}';
+ }
+ _toStringList.add(this);
+ String result = IterableMixinWorkaround.toStringIterable(this);
+ _toStringList.remove(this);
+ return result;
+ }
int get length => _length;

Powered by Google App Engine
This is Rietveld 408576698