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

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

Issue 27028003: Revert toString output changes of Queues, and LinkedLists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_collection_dev/iterable.dart ('k') | sdk/lib/collection/queue.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 7
8 /** 8 /**
9 * A linked list implementation, providing O(1) removal(unlink) of elements and 9 * A linked list implementation, providing O(1) removal(unlink) of elements and
10 * manual traversal through [next] and [previous]. 10 * manual traversal through [next] and [previous].
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 * If [entry] is not in the list, `false` is returned. 54 * If [entry] is not in the list, `false` is returned.
55 */ 55 */
56 bool remove(E entry) { 56 bool remove(E entry) {
57 if (entry._list != this) return false; 57 if (entry._list != this) return false;
58 _unlink(entry); // Unlink will decrement length. 58 _unlink(entry); // Unlink will decrement length.
59 return true; 59 return true;
60 } 60 }
61 61
62 Iterator<E> get iterator => new _LinkedListIterator<E>(this); 62 Iterator<E> get iterator => new _LinkedListIterator<E>(this);
63 63
64 // TODO(zarah) Remove this, and let it be inherited by IterableMixin
65 String toString() => IterableMixinWorkaround.toStringIterable(this, '{', '}');
66
64 int get length => _length; 67 int get length => _length;
65 68
66 void clear() { 69 void clear() {
67 _modificationCount++; 70 _modificationCount++;
68 _LinkedListLink next = _next; 71 _LinkedListLink next = _next;
69 while (!identical(next, this)) { 72 while (!identical(next, this)) {
70 E entry = next; 73 E entry = next;
71 next = entry._next; 74 next = entry._next;
72 entry._next = entry._previous = entry._list = null; 75 entry._next = entry._previous = entry._list = null;
73 } 76 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 _list._insertAfter(this, entry); 226 _list._insertAfter(this, entry);
224 } 227 }
225 228
226 /** 229 /**
227 * Insert an element before this. 230 * Insert an element before this.
228 */ 231 */
229 void insertBefore(E entry) { 232 void insertBefore(E entry) {
230 _list._insertAfter(_previous, entry); 233 _list._insertAfter(_previous, entry);
231 } 234 }
232 } 235 }
OLDNEW
« no previous file with comments | « sdk/lib/_collection_dev/iterable.dart ('k') | sdk/lib/collection/queue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698