| 180 | |
| 181 | |
| 182 | void |
| 183 | pqueue_change_priority(pqueue_t *q, |
| 184 | pqueue_pri_t new_pri, |
| 185 | void *d) |
| 186 | { |
| 187 | size_t posn; |
| 188 | pqueue_pri_t old_pri = q->getpri(d); |
| 189 | |
| 190 | q->setpri(d, new_pri); |
| 191 | posn = q->getpos(d); |
| 192 | if (q->cmppri(old_pri, new_pri)) |
| 193 | bubble_up(q, posn); |
| 194 | else |
| 195 | percolate_down(q, posn); |
| 196 | } |
| 197 | |
| 198 | |
| 199 | int |
no test coverage detected