pike.git / lib / modules / ADT.pmod / Heap.pike

version» Context lines:

pike.git/lib/modules/ADT.pmod/Heap.pike:22: Inside #if defined(ADT_HEAP_DEBUG)
     #ifdef ADT_HEAP_DEBUG   void verify_heap()   {    for(int e=0; e<num_values; e++) {    if (!values[e] || !values[e]->is_adt_heap_element)    error("Error in HEAP: Position %d has no element.\n", e);    if (values[e]->pos != e)    error("Error in HEAP: Element %d has invalid position: %d.\n",    e, values[e]->pos); -  if(values[(e-1)/2] > values[e]) +  if(e && (values[(e-1)/2] > values[e]))    error("Error in HEAP (%d, %d) num_values=%d\n",    (e-1)/2, e, num_values);    }   }   #else   #define verify_heap()   #endif      protected void adjust_down(int elem)   {