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

Unified Diff: corelib/src/implementation/queue.dart

Issue 8510066: Fix String.trim implementation (follow spec). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 | runtime/lib/string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/implementation/queue.dart
===================================================================
--- corelib/src/implementation/queue.dart (revision 1520)
+++ corelib/src/implementation/queue.dart (working copy)
@@ -171,24 +171,27 @@
void forEach(void f(E element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
while (entry !== _sentinel) {
+ DoubleLinkedQueueEntry<E> nextEntry = entry._next;
f(entry._element);
- entry = entry._next;
+ entry = nextEntry;
}
}
void forEachEntry(void f(DoubleLinkedQueueEntry<E> element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
while (entry !== _sentinel) {
+ DoubleLinkedQueueEntry<E> nextEntry = entry._next;
f(entry);
- entry = entry._next;
+ entry = nextEntry;
}
}
bool every(bool f(E element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
while (entry !== _sentinel) {
+ DoubleLinkedQueueEntry<E> nextEntry = entry._next;
if (!f(entry._element)) return false;
- entry = entry._next;
+ entry = nextEntry;
}
return true;
}
@@ -196,8 +199,9 @@
bool some(bool f(E element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
while (entry !== _sentinel) {
+ DoubleLinkedQueueEntry<E> nextEntry = entry._next;
if (f(entry._element)) return true;
- entry = entry._next;
+ entry = nextEntry;
}
return false;
}
@@ -206,8 +210,9 @@
Queue<E> other = new Queue<E>();
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
while (entry !== _sentinel) {
+ DoubleLinkedQueueEntry<E> nextEntry = entry._next;
if (f(entry._element)) other.addLast(entry._element);
- entry = entry._next;
+ entry = nextEntry;
}
return other;
}
« no previous file with comments | « no previous file | runtime/lib/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698