Thread (7 messages) flat view 7 messages, 3 authors, 2021-09-02
STALE1811d

[PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records

From: Carlo Marcelo Arenas Belón <hidden>
Date: 2021-09-02 05:30:45
Subsystem: the rest · Maintainer: Linus Torvalds

not a very useful option, but the fact the main logic is done inside
and assert that then gets compiled out when -DNDEBUG might be worth
reconsidering.

Signed-off-by: Carlo Marcelo Arenas Belón <redacted>
---
 reftable/pq.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/reftable/pq.c b/reftable/pq.c
index 8918d158e2..a6acca006b 100644
--- a/reftable/pq.c
+++ b/reftable/pq.c
@@ -43,12 +43,14 @@ int merged_iter_pqueue_is_empty(struct merged_iter_pqueue pq)
 
 void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
 {
+#ifndef NDEBUG
 	int i = 0;
 	for (i = 1; i < pq.len; i++) {
 		int parent = (i - 1) / 2;
 
 		assert(pq_less(pq.heap[parent], pq.heap[i]));
 	}
+#endif
 }
 
 struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq)
-- 
2.33.0.481.g26d3bed244
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help