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

Unified Diff: sdk/lib/core/queue.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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 | « sdk/lib/core/options.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/queue.dart
diff --git a/sdk/lib/core/queue.dart b/sdk/lib/core/queue.dart
index bf1e49c2113bbc97e3066b5a9e98891c697aee05..e6e997fb9bb110761b6d77222969c03c39c4af23 100644
--- a/sdk/lib/core/queue.dart
+++ b/sdk/lib/core/queue.dart
@@ -234,7 +234,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
}
bool get isEmpty {
- return (_sentinel._next === _sentinel);
+ return (identical(_sentinel._next, _sentinel));
}
void clear() {
@@ -244,7 +244,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
void forEach(void f(E element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
- while (entry !== _sentinel) {
+ while (!identical(entry, _sentinel)) {
DoubleLinkedQueueEntry<E> nextEntry = entry._next;
f(entry._element);
entry = nextEntry;
@@ -253,7 +253,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
void forEachEntry(void f(DoubleLinkedQueueEntry<E> element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
- while (entry !== _sentinel) {
+ while (!identical(entry, _sentinel)) {
DoubleLinkedQueueEntry<E> nextEntry = entry._next;
f(entry);
entry = nextEntry;
@@ -262,7 +262,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
bool every(bool f(E element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
- while (entry !== _sentinel) {
+ while (!identical(entry, _sentinel)) {
DoubleLinkedQueueEntry<E> nextEntry = entry._next;
if (!f(entry._element)) return false;
entry = nextEntry;
@@ -272,7 +272,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
bool some(bool f(E element)) {
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
- while (entry !== _sentinel) {
+ while (!identical(entry, _sentinel)) {
DoubleLinkedQueueEntry<E> nextEntry = entry._next;
if (f(entry._element)) return true;
entry = nextEntry;
@@ -283,7 +283,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
Queue map(f(E element)) {
Queue other = new Queue();
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
- while (entry !== _sentinel) {
+ while (!identical(entry, _sentinel)) {
DoubleLinkedQueueEntry<E> nextEntry = entry._next;
other.addLast(f(entry._element));
entry = nextEntry;
@@ -299,7 +299,7 @@ class DoubleLinkedQueue<E> implements Queue<E> {
Queue<E> filter(bool f(E element)) {
Queue<E> other = new Queue<E>();
DoubleLinkedQueueEntry<E> entry = _sentinel._next;
- while (entry !== _sentinel) {
+ while (!identical(entry, _sentinel)) {
DoubleLinkedQueueEntry<E> nextEntry = entry._next;
if (f(entry._element)) other.addLast(entry._element);
entry = nextEntry;
@@ -325,7 +325,7 @@ class _DoubleLinkedQueueIterator<E> implements Iterator<E> {
}
bool get hasNext {
- return _currentEntry._next !== _sentinel;
+ return !identical(_currentEntry._next, _sentinel);
}
E next() {
« no previous file with comments | « sdk/lib/core/options.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698