diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-03-26 13:46:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-03-26 13:46:29 -0400 |
commit | 7204b916669f9b9ff0dae689088a5ab0344edebd (patch) | |
tree | ba7d6f1fd6cc267d541b462679c10a4eba81a060 /minheap-internal.h | |
parent | e1e703d2f5d35118e80be6a0e780682284ce8bc3 (diff) | |
download | libevent-7204b916669f9b9ff0dae689088a5ab0344edebd.tar.gz |
Remove a needless min_heap_shift_up_() call
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.
Diffstat (limited to 'minheap-internal.h')
-rw-r--r-- | minheap-internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/minheap-internal.h b/minheap-internal.h index a240bf3a..f877e55e 100644 --- a/minheap-internal.h +++ b/minheap-internal.h @@ -153,7 +153,7 @@ void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e) 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_ */ |