summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/alarm.c5
2 files changed, 2 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b0fba9..2942b24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -99,7 +99,7 @@ o remove unused prototypes in network.h
o check if the received packet is large enough
o introduce alarm_pending()
o cleanup: use size_t instead of integer
-o cleanup: remove unrequired initialization in the rbtree-based alarm
+o several cleanups in the rbtree-based alarm
version 0.9.5 (2007/07/29)
------------------------------
diff --git a/src/alarm.c b/src/alarm.c
index 470efdd..a3bdbe2 100644
--- a/src/alarm.c
+++ b/src/alarm.c
@@ -128,15 +128,12 @@ do_alarm_run(struct timeval *next_run)
gettimeofday(&tv, NULL);
- node = rb_first(&alarm_root);
- while (node) {
+ for (node = rb_first(&alarm_root); node; node = rb_next(node)) {
this = container_of(node, struct alarm_block, node);
if (timercmp(&this->tv, &tv, >))
break;
- node = rb_next(node);
-
list_add(&this->list, &alarm_run_queue);
}