From ca7a821da9e637b9f4bc43c564bd2007b7121353 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 10 Mar 2017 01:38:35 +0100 Subject: [PATCH] Improve performance of comparison of RB-TREE. --- m-rbtree.h | 1 + 1 file changed, 1 insertion(+) diff --git a/m-rbtree.h b/m-rbtree.h index ea33f18e..1d04a31e 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -761,6 +761,7 @@ typedef enum { static inline bool M_C3(rbtree_,name,_equal_p)(const tree_t t1, const tree_t t2) { \ RBTREEI_CONTRACT(t1); \ RBTREEI_CONTRACT(t2); \ + if (t1->size != t2->size) return false; \ M_C3(rbtree_it_, name, _t) it1; \ M_C3(rbtree_it_, name, _t) it2; \ /* NOTE: We can't compare two tree directly as they can be \