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

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

Issue 2015513006: Make linked-list non-circular. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | tests/lib/collection/linked_list_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/linked_list.dart
diff --git a/sdk/lib/collection/linked_list.dart b/sdk/lib/collection/linked_list.dart
index 481f04dde02fd599b8d9ac36d131cb1e360c221b..f1b55bb877482f637e433d3fdf597c5ec8757f40 100644
--- a/sdk/lib/collection/linked_list.dart
+++ b/sdk/lib/collection/linked_list.dart
@@ -258,13 +258,13 @@ abstract class LinkedListEntry<E extends LinkedListEntry<E>> {
}
/**
- * Return the succeessor of this element in its linked list.
+ * Return the successor of this element in its linked list.
Lasse Reichstein Nielsen 2016/05/26 15:24:10 Poor "e" doesn't get to be duplicated like all the
*
* Returns `null` if there is no successor in the linked list, or if this
* entry is not currently in any list.
*/
E get next {
- if (identical(this, _next)) return null;
+ if (_list == null || identical(_list.first, _next)) return null;
return _next;
}
@@ -275,7 +275,7 @@ abstract class LinkedListEntry<E extends LinkedListEntry<E>> {
* entry is not currently in any list.
*/
E get previous {
- if (identical(this, _previous)) return null;
+ if (_list == null || identical(this, _list.first)) return null;
return _previous;
}
« no previous file with comments | « no previous file | tests/lib/collection/linked_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698