Rename method _it_to_p into _it_until_p. Add method _it_while_p

This commit is contained in:
Patrick Pelissier committed 2019-07-03 18:57:24 +02:00
1 parent ec7b5dd120
commit 37f3cd6a72
5 files changed
+50 -7

No files matched your search

+18 -1
View File
@@ -513,7 +513,7 @@ typedef enum {
} \
\
static inline bool \
M_C(name, _it_to_p)(it_t it, type const data) \
M_C(name, _it_until_p)(it_t it, type const data) \
{ \
assert (it != NULL); \
if (it->cpt == 0) return true; \
@@ -523,6 +523,23 @@ typedef enum {
return (cmp >= 0); \
} \
\
static inline bool \
M_C(name, _it_while_p)(it_t it, type const data) \
{ \
assert (it != NULL); \
if (it->cpt == 0) return true; \
assert (it->cpt > 0 && it->cpt < RBTREEI_MAX_STACK); \
node_t *n = it->stack[it->cpt-1]; \
int cmp = M_CALL_CMP(oplist, n->data, data); \
return (cmp <= 0); \
} \
\
static inline bool M_ATTR_DEPRECATED \
M_C(name, _it_to_p)(it_t it, type const data) \
{ \
return M_C(name, _it_until_p)(it, data); \
} \
\
static inline type * \
M_C(name, _min)(const tree_t tree) \
{ \