equal
deleted
inserted
replaced
432 |
432 |
433 #define ARR(i) tpf->stack[(i)-1] |
433 #define ARR(i) tpf->stack[(i)-1] |
434 |
434 |
435 // called after a new element was added in the queue at the last index. |
435 // called after a new element was added in the queue at the last index. |
436 // move it down to the proper position |
436 // move it down to the proper position |
437 static void INLINE HeapifyUp(NewTrackPathFinder *tpf) |
437 static void inline HeapifyUp(NewTrackPathFinder *tpf) |
438 { |
438 { |
439 StackedItem si; |
439 StackedItem si; |
440 int i = ++tpf->nstack; |
440 int i = ++tpf->nstack; |
441 |
441 |
442 while (i != 1 && ARR(i).cur_length < ARR(i>>1).cur_length) { |
442 while (i != 1 && ARR(i).cur_length < ARR(i>>1).cur_length) { |
446 i>>=1; |
446 i>>=1; |
447 } |
447 } |
448 } |
448 } |
449 |
449 |
450 // called after the element 0 was eaten. fill it with a new element |
450 // called after the element 0 was eaten. fill it with a new element |
451 static void INLINE HeapifyDown(NewTrackPathFinder *tpf) |
451 static void inline HeapifyDown(NewTrackPathFinder *tpf) |
452 { |
452 { |
453 StackedItem si; |
453 StackedItem si; |
454 int i = 1, j; |
454 int i = 1, j; |
455 int n = --tpf->nstack; |
455 int n = --tpf->nstack; |
456 |
456 |