travis-ci: record and skip successfully built trees
[gitweb.git] / prio-queue.c
index 76782b66d4dde5bf01190963b19c403856756860..126d09672738533b6ecc6b94b7405dff888bbaf6 100644 (file)
@@ -12,9 +12,7 @@ static inline int compare(struct prio_queue *queue, int i, int j)
 
 static inline void swap(struct prio_queue *queue, int i, int j)
 {
-       struct prio_queue_entry tmp = queue->array[i];
-       queue->array[i] = queue->array[j];
-       queue->array[j] = tmp;
+       SWAP(queue->array[i], queue->array[j]);
 }
 
 void prio_queue_reverse(struct prio_queue *queue)
@@ -29,10 +27,9 @@ void prio_queue_reverse(struct prio_queue *queue)
 
 void clear_prio_queue(struct prio_queue *queue)
 {
-       free(queue->array);
+       FREE_AND_NULL(queue->array);
        queue->nr = 0;
        queue->alloc = 0;
-       queue->array = NULL;
        queue->insertion_ctr = 0;
 }