diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2020-02-13 08:18:45 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2020-02-13 08:18:45 +0000 |
commit | ffb71c28d76aa0c077c14342631595dce515f737 (patch) | |
tree | 2b1547610b2483e132e36a30fd14287de95a63af /usr.bin/dig | |
parent | 661f1bfc9372248d334b2486d16dd9d9c834e312 (diff) |
remove ISC_HEAP_CHECK knob, it was never turned
Diffstat (limited to 'usr.bin/dig')
-rw-r--r-- | usr.bin/dig/lib/isc/heap.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/usr.bin/dig/lib/isc/heap.c b/usr.bin/dig/lib/isc/heap.c index f277ec39ab8..98d240bd0a1 100644 --- a/usr.bin/dig/lib/isc/heap.c +++ b/usr.bin/dig/lib/isc/heap.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: heap.c,v 1.2 2020/02/12 13:05:04 jsg Exp $ */ +/* $Id: heap.c,v 1.3 2020/02/13 08:18:44 florian Exp $ */ /*! \file * Heap implementation of priority queues adapted from the following: @@ -69,18 +69,6 @@ struct isc_heap { isc_heapindex_t index; }; -#ifdef ISC_HEAP_CHECK -static void -heap_check(isc_heap_t *heap) { - unsigned int i; - for (i = 1; i <= heap->last; i++) { - INSIST(HEAPCONDITION(i)); - } -} -#else -#define heap_check(x) (void)0 -#endif - isc_result_t isc_heap_create(isc_heapcompare_t compare, isc_heapindex_t idx, unsigned int size_increment, @@ -162,7 +150,6 @@ float_up(isc_heap_t *heap, unsigned int i, void *elt) { (heap->index)(heap->array[i], i); INSIST(HEAPCONDITION(i)); - heap_check(heap); } static void @@ -188,7 +175,6 @@ sink_down(isc_heap_t *heap, unsigned int i, void *elt) { (heap->index)(heap->array[i], i); INSIST(HEAPCONDITION(i)); - heap_check(heap); } isc_result_t @@ -197,7 +183,6 @@ isc_heap_insert(isc_heap_t *heap, void *elt) { REQUIRE(VALID_HEAP(heap)); - heap_check(heap); new_last = heap->last + 1; RUNTIME_CHECK(new_last > 0); /* overflow check */ if (new_last >= heap->size && !resize(heap)) @@ -217,13 +202,11 @@ isc_heap_delete(isc_heap_t *heap, unsigned int idx) { REQUIRE(VALID_HEAP(heap)); REQUIRE(idx >= 1 && idx <= heap->last); - heap_check(heap); if (heap->index != NULL) (heap->index)(heap->array[idx], 0); if (idx == heap->last) { heap->array[heap->last] = NULL; heap->last--; - heap_check(heap); } else { elt = heap->array[heap->last]; heap->array[heap->last] = NULL; @@ -259,7 +242,6 @@ isc_heap_element(isc_heap_t *heap, unsigned int idx) { REQUIRE(VALID_HEAP(heap)); REQUIRE(idx >= 1); - heap_check(heap); if (idx <= heap->last) return (heap->array[idx]); return (NULL); |