| 134 | /* Move element up into appropriate position in heap. */ |
| 135 | |
| 136 | static void |
| 137 | heapify_up (void **array, idx_t count, |
| 138 | int (*compare) (void const *, void const *)) |
| 139 | { |
| 140 | idx_t k = count; |
| 141 | void *new_element = array[k]; |
| 142 | |
| 143 | while (k != 1 && compare (array[k >> 1], new_element) <= 0) |
| 144 | { |
| 145 | array[k] = array[k >> 1]; |
| 146 | k >>= 1; |
| 147 | } |
| 148 | |
| 149 | array[k] = new_element; |
| 150 | } |
no test coverage detected