From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: git@vger.kernel.org
Cc: hanwen@google.com, "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Subject: [PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records
Date: Wed, 1 Sep 2021 22:30:23 -0700 [thread overview]
Message-ID: <20210902053023.44006-4-carenas@gmail.com> (raw)
In-Reply-To: <20210902053023.44006-1-carenas@gmail.com>
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 <carenas@gmail.com>
---
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
next prev parent reply other threads:[~2021-09-02 5:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 5:30 [PATCH 0/3] hn/reftable: fixes for building with -DNDEBUG Carlo Marcelo Arenas Belón
2021-09-02 5:30 ` [PATCH 1/3] fixup! refs: RFC: Reftable support for git-core Carlo Marcelo Arenas Belón
2021-09-02 9:05 ` Jeff King
2021-09-02 9:26 ` Han-Wen Nienhuys
2021-09-02 5:30 ` [PATCH 2/3] fixup! reftable: add merged table view Carlo Marcelo Arenas Belón
2021-09-02 5:30 ` Carlo Marcelo Arenas Belón [this message]
2021-09-02 9:09 ` [PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records Jeff King
2021-09-02 20:08 ` Junio C Hamano
2021-09-02 22:40 ` Jeff King
2021-09-03 4:42 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210902053023.44006-4-carenas@gmail.com \
--to=carenas@gmail.com \
--cc=git@vger.kernel.org \
--cc=hanwen@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).