Skip to content

Commit

Permalink
fix: method redefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
EDB02 authored and Tonidotpy committed Nov 20, 2023
1 parent 79667c8 commit c0230f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions priority-queue/priority_queue_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool PQH_insert(PQH *pq, int priority, uint8_t *element)
int i = pq->tail;
pq->tail++;
pq->elem_cnt++;
while(i > 0 && pq->compare(pq->priority[_PQ_parent(i)], pq->priority[i]))
while(i > 0 && pq->compare(pq->priority[_PQH_parent(i)], pq->priority[i]))
{
_PQH_swap(pq, _PQH_parent(i), i);
i = _PQH_parent(i);
Expand Down Expand Up @@ -70,7 +70,7 @@ bool PQH_pop(PQH *pq, int *priority, uint8_t *element)

void _PQH_heap_restore(PQH *pq, int i)
{
int l = _PQH_left(i), r = _PQ_right(i);
int l = _PQH_left(i), r = _PQH_right(i);
int best = i;
if(l < pq->elem_cnt && pq->compare(pq->priority[i], pq->priority[l]))
best = l;
Expand Down

0 comments on commit c0230f1

Please sign in to comment.