Fix timers

This commit is contained in:
Přemysl Eric Janouch 2014-09-20 02:08:30 +02:00
parent 125521ddc1
commit a1c9018847

View File

@ -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 *left = self->info + 2 * index + 1;
info_t *right = self->info + 2 * index + 2; info_t *right = self->info + 2 * index + 2;
info_t *largest = parent; info_t *lowest = parent;
if (left < end && left->when > largest->when) if (left < end && left->when < lowest->when)
largest = left; lowest = left;
if (right < end && right->when > largest->when) if (right < end && right->when < lowest->when)
largest = right; lowest = right;
if (parent == largest) if (parent == lowest)
break; break;
info_t tmp = *parent; info_t tmp = *parent;
*parent = *largest; *parent = *lowest;
*largest = tmp; *lowest = tmp;
index = largest - self->info; index = lowest - self->info;
} }
} }