Previously, every call to min_heap_shift_down_() would invoke
min_heap_shift_up_() at the end. This used to be necessary in the
first version of the minheap code, since min_heap_erase() would call
min_heap_shift_down_() unconditionally. But when patch
8b7a3b36763
from Marko Kreen fixed min_heap_erase() to be more sensible, we left
the weird behavior of min_heap_shift_down_() in place.
Fortunately, "cui" noticed this and reported it on Niels's blog.
hole_index = min_child;
min_child = 2 * (hole_index + 1);
}
- min_heap_shift_up_(s, hole_index, e);
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
}
#endif /* _MIN_HEAP_H_ */