aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-20 02:08:30 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-20 02:08:30 +0200
commita1c9018847bc93688dd89eb22eed6208aeb88876 (patch)
tree0ead822b350463913ef0c6b94020c1553cfa40af
parent125521ddc18647d54164d1910a753465c50fb010 (diff)
downloadxK-a1c9018847bc93688dd89eb22eed6208aeb88876.tar.gz
xK-a1c9018847bc93688dd89eb22eed6208aeb88876.tar.xz
xK-a1c9018847bc93688dd89eb22eed6208aeb88876.zip
Fix timers
-rw-r--r--common.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/common.c b/common.c
index c9d790d..d3c66a2 100644
--- a/common.c
+++ b/common.c
@@ -893,19 +893,19 @@ poller_timers_heapify_down (struct poller_timers *self, size_t index)
info_t *left = self->info + 2 * index + 1;
info_t *right = self->info + 2 * index + 2;
- info_t *largest = parent;
- if (left < end && left->when > largest->when)
- largest = left;
- if (right < end && right->when > largest->when)
- largest = right;
- if (parent == largest)
+ info_t *lowest = parent;
+ if (left < end && left->when < lowest->when)
+ lowest = left;
+ if (right < end && right->when < lowest->when)
+ lowest = right;
+ if (parent == lowest)
break;
info_t tmp = *parent;
- *parent = *largest;
- *largest = tmp;
+ *parent = *lowest;
+ *lowest = tmp;
- index = largest - self->info;
+ index = lowest - self->info;
}
}