]> mj.ucw.cz Git - libucw.git/blobdiff - lib/heap.h
Initial version of SQL gathering utility gsql added.
[libucw.git] / lib / heap.h
index 268cc2572cd8d3ad855464d7c8a6e2a5b41dead7..7be54cfa54665ee1808c00c0fb8ce9e2b78a661a 100644 (file)
@@ -71,9 +71,9 @@
   do {                                                                                 \
     uns j, l, u;                                                                       \
     type x;                                                                            \
-    swap(heap,pos,num,x);                                                              \
-    num--;                                                                             \
     j = pos;                                                                           \
+    swap(heap,j,num,x);                                                                        \
+    num--;                                                                             \
     if (less(heap[j], heap[num+1]))                                                    \
       HEAP_BUBBLE_UP_J(heap,num,less,swap)                                             \
     else                                                                               \