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

Unified Diff: lib/compiler/implementation/util/link_implementation.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/util/link.dart ('k') | lib/compiler/implementation/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/util/link_implementation.dart
diff --git a/lib/compiler/implementation/util/link_implementation.dart b/lib/compiler/implementation/util/link_implementation.dart
index 20cefe5c100a2784a6d6735ddf8671085d6dab86..783fee36d0bd13903de2b6fdf21cf4d0a31d1012 100644
--- a/lib/compiler/implementation/util/link_implementation.dart
+++ b/lib/compiler/implementation/util/link_implementation.dart
@@ -5,7 +5,7 @@
class LinkIterator<T> implements Iterator<T> {
Link<T> current;
LinkIterator(Link<T> this.current);
- bool get hasNext => !current.isEmpty();
+ bool get hasNext => !current.isEmpty;
T next() {
T result = current.head;
current = current.tail;
@@ -28,7 +28,7 @@ class LinkEntry<T> extends Link<T> {
void printOn(StringBuffer buffer, [separatedBy]) {
buffer.add(head);
if (separatedBy == null) separatedBy = '';
- for (Link link = tail; !link.isEmpty(); link = link.tail) {
+ for (Link link = tail; !link.isEmpty; link = link.tail) {
buffer.add(separatedBy);
buffer.add(link.head);
}
@@ -44,7 +44,7 @@ class LinkEntry<T> extends Link<T> {
Link<T> reverse() {
Link<T> result = const Link();
- for (Link<T> link = this; !link.isEmpty(); link = link.tail) {
+ for (Link<T> link = this; !link.isEmpty; link = link.tail) {
result = result.prepend(link.head);
}
return result;
@@ -52,25 +52,25 @@ class LinkEntry<T> extends Link<T> {
Link<T> reversePrependAll(Link<T> from) {
Link<T> result;
- for (result = this; !from.isEmpty(); from = from.tail) {
+ for (result = this; !from.isEmpty; from = from.tail) {
result = result.prepend(from.head);
}
return result;
}
- bool isEmpty() => false;
+ bool get isEmpty => false;
List<T> toList() {
List<T> list = new List<T>();
- for (Link<T> link = this; !link.isEmpty(); link = link.tail) {
+ for (Link<T> link = this; !link.isEmpty; link = link.tail) {
list.addLast(link.head);
}
return list;
}
void forEach(void f(T element)) {
- for (Link<T> link = this; !link.isEmpty(); link = link.tail) {
+ for (Link<T> link = this; !link.isEmpty; link = link.tail) {
f(link.head);
}
}
@@ -78,14 +78,14 @@ class LinkEntry<T> extends Link<T> {
bool operator ==(other) {
if (other is !Link<T>) return false;
Link<T> myElements = this;
- while (!myElements.isEmpty() && !other.isEmpty()) {
+ while (!myElements.isEmpty && !other.isEmpty) {
if (myElements.head != other.head) {
return false;
}
myElements = myElements.tail;
other = other.tail;
}
- return myElements.isEmpty() && other.isEmpty();
+ return myElements.isEmpty && other.isEmpty;
}
}
« no previous file with comments | « lib/compiler/implementation/util/link.dart ('k') | lib/compiler/implementation/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698