Merge branch 'Fast-Fix' of lirent/libcdsb into develop

This commit is contained in:
Gregory Lirent 2022-08-24 13:52:50 +03:00 committed by Gogs
commit 363906cd30
5 changed files with 16 additions and 16 deletions

View File

@ -24,7 +24,7 @@ extern rbnode_t* libcdsb_builtin_rbtree_node_delete(rbnode_t** root, rbnode_t* n
extern stack_t libcdsb_builtin_rbtree_iter_inorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_preorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_postorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_breath_first(rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_breadth_first(rbnode_t** root, bool reverse);
#define rbnode_empty ((rbnode_t*)LIBCDSB_BUILTIN_RBTREE_NODE_EMPTY)
#define rbnode_create(v, p, c) ((rbnode_t*)libcdsb_builtin_rbtree_node_create(v, p, c, sizeof(rbnode_t)))
@ -37,6 +37,6 @@ extern stack_t libcdsb_builtin_rbtree_iter_breath_first(rbnode_t** root, bool re
#define rbiter_inorder libcdsb_builtin_rbtree_iter_inorder
#define rbiter_preorder libcdsb_builtin_rbtree_iter_preorder
#define rbiter_postorder libcdsb_builtin_rbtree_iter_postorder
#define rbiter_breath_first libcdsb_builtin_rbtree_iter_breath_first
#define rbiter_breadth_first libcdsb_builtin_rbtree_iter_breadth_first
#endif /* LIBCDSB_SRC_INTERNAL_RBTREE_H */

View File

@ -89,7 +89,7 @@ int libcdsb_map_foreach(map_t* x, void* data, map_access_callback callback, rbfo
default:
case RBFOREACH_BREADTH_FIRST: if (reverse || flush) {
iter = miter_breath_first(&x->root, type&RBFOREACH_REVERSE);
iter = miter_breadth_first(&x->root, type&RBFOREACH_REVERSE);
break;
} else return libcdsb_builtin_foreach(x, data, callback);
}

View File

@ -38,6 +38,6 @@ static_assert(offsetof(struct libcdsb_set, type) == offsetof(struct l
#define miter_inorder(x, reverse) rbiter_inorder((void*)x, reverse)
#define miter_preorder(x, reverse) rbiter_preorder((void*)x, reverse)
#define miter_postorder(x, reverse) rbiter_postorder((void*)x, reverse)
#define miter_breath_first(x, reverse) rbiter_breath_first((void*)x, reverse)
#define miter_breadth_first(x, reverse) rbiter_breadth_first((void*)x, reverse)
#endif /* LIBCDSB_SRC_MAP_INCLUDE_H */

View File

@ -316,7 +316,7 @@ stack_t libcdsb_builtin_rbtree_iter_postorder(rbnode_t** root, bool reverse) {
}
stack_t libcdsb_builtin_rbtree_iter_breath_first(rbnode_t** root, bool reverse) {
stack_t libcdsb_builtin_rbtree_iter_breadth_first(rbnode_t** root, bool reverse) {
stack_t z, *top, *bot, *cur;
rbnode_t* n;

View File

@ -89,7 +89,7 @@ int libcdsb_vset_foreach(set_t* x, void* data, vset_access_callback callback, rb
default:
case RBFOREACH_BREADTH_FIRST: if (reverse || flush) {
iter = rbiter_breath_first(&x->root, type&RBFOREACH_REVERSE);
iter = rbiter_breadth_first(&x->root, type&RBFOREACH_REVERSE);
break;
} else return libcdsb_builtin_foreach(x, data, callback);
}