From 0171c49413dd8f762ba79b9d031cfd442a96ca3d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 5 Jul 2021 22:45:57 +0200 Subject: [PATCH] Unlikely some if conditions. --- m-rbtree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m-rbtree.h b/m-rbtree.h index fbfea9c8..3b95266a 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -590,7 +590,7 @@ typedef enum { M_C(name, _it_until_p)(it_t it, type const data) \ { \ M_ASSERT (it != NULL); \ - if (it->cpt == 0) return true; \ + if (M_UNLIKELY(it->cpt == 0)) return true; \ M_ASSERT (it->cpt > 0 && it->cpt < M_RBTR33_MAX_STACK); \ node_t *n = it->stack[it->cpt-1]; \ int cmp = M_CALL_CMP(oplist, n->data, data); \ @@ -601,7 +601,7 @@ typedef enum { M_C(name, _it_while_p)(it_t it, type const data) \ { \ M_ASSERT (it != NULL); \ - if (it->cpt == 0) return true; \ + if (M_UNLIKELY(it->cpt == 0)) return true; \ M_ASSERT (it->cpt > 0 && it->cpt < M_RBTR33_MAX_STACK); \ node_t *n = it->stack[it->cpt-1]; \ int cmp = M_CALL_CMP(oplist, n->data, data); \