]> mj.ucw.cz Git - libucw.git/commitdiff
Instead of adding HEAP_INCREASE_POS as Tom requested, I've modified
authorMartin Mares <mj@ucw.cz>
Mon, 16 Jan 2006 14:00:03 +0000 (14:00 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 16 Jan 2006 14:00:03 +0000 (14:00 +0000)
HEAP_INCREASE. I think this is a better solution, because increasing
the value of the root element is too special and knowing that doesn't
enable us to do any special optimizations anyway.

lib/heap.h

index b7bc1065f5e159f646db5a9e6cb581a765324ac7..4f83776f5cb0dff38dbf646a702b23775926ebed 100644 (file)
     HEAP_BUBBLE_UP_J(heap,num,less,swap);                                              \
   } while(0)
 
-#define HEAP_INCREASE(type,heap,num,less,swap)                                         \
+#define HEAP_INCREASE(type,heap,num,less,swap,pos)                                     \
   do {                                                                                 \
     uns _j, _l;                                                                                \
     type x;                                                                            \
-    _j = 1;                                                                            \
+    _j = pos;                                                                          \
     HEAP_BUBBLE_DOWN_J(heap,num,less,swap);                                            \
   } while(0)