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

Unified Diff: sdk/lib/io/timer_impl.dart

Issue 203253003: Clean up style in timer_impl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/timer_impl.dart
diff --git a/sdk/lib/io/timer_impl.dart b/sdk/lib/io/timer_impl.dart
index 495c70e6f2a243dcc0d711b12a8127169ab1ca71..51f09017c451e20399f65e58fded0e32d9021ca0 100644
--- a/sdk/lib/io/timer_impl.dart
+++ b/sdk/lib/io/timer_impl.dart
@@ -190,7 +190,7 @@ class _Timer implements Timer {
_clear();
if (!_isInHeap) return;
assert(_wakeupTime != 0);
- bool update = _firstZeroTimer == null && _heap.isFirst(this);
+ bool update = (_firstZeroTimer == null) && _heap.isFirst(this);
_heap.remove(this);
if (update) {
_notifyEventHandler();
@@ -207,10 +207,12 @@ class _Timer implements Timer {
bool _addTimerToHeap() {
if (_wakeupTime == 0) {
if (_firstZeroTimer == null) {
- _lastZeroTimer = _firstZeroTimer = this;
+ _lastZeroTimer = this;
+ _firstZeroTimer = this;
return true;
} else {
- _lastZeroTimer = _lastZeroTimer._indexOrNext = this;
+ _lastZeroTimer._indexOrNext = this;
+ _lastZeroTimer = this;
return false;
}
} else {
@@ -257,13 +259,16 @@ class _Timer implements Timer {
// Collect all pending timers.
var timer = _firstZeroTimer;
var nextTimer = _lastZeroTimer;
- _firstZeroTimer = _lastZeroTimer = null;
+ _firstZeroTimer = null;
+ _lastZeroTimer = null;
while (_heap.isNotEmpty && _heap.first._wakeupTime <= currentTime) {
var next = _heap.removeFirst();
if (timer == null) {
- nextTimer = timer = next;
+ nextTimer = next;
+ timer = next;
} else {
- nextTimer = nextTimer._indexOrNext = next;
+ nextTimer._indexOrNext = next;
+ nextTimer = next;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698