diff --git a/src/map/modify.c b/src/map/modify.c index 2b071e5..7c77a3e 100644 --- a/src/map/modify.c +++ b/src/map/modify.c @@ -11,7 +11,7 @@ bool libcdsb_map_update(map_t* x, vtype_variable key, vtype_variable value, void if (!mnode_is_empty(n = x->root)) { do { p = n; - cmp = vtype_compare(key.pointer, key.type, vnode_peek(&n->key, key.type), key.type); + cmp = vtype_compare(key.pointer, key.type, vnode_peek(&n->key, x->type), x->type); if (cmp == 0) { if (callback) callback(libcdsb_variable_build(vnode_peek(&n->key, x->type), x->type), @@ -58,7 +58,7 @@ bool libcdsb_map_inject(map_t* x, vtype_variable key, vtype_variable value, void if (!mnode_is_empty(n)) { do { p = n; - cmp = vtype_compare(key.pointer, key.type, vnode_peek(&n->key, key.type), key.type); + cmp = vtype_compare(key.pointer, key.type, vnode_peek(&n->key, x->type), x->type); if (cmp == 0) { if (callback) callback(libcdsb_variable_build(vnode_peek(&n->key, x->type), x->type), diff --git a/src/set/modify.c b/src/set/modify.c index a37e4f8..9f0abc3 100644 --- a/src/set/modify.c +++ b/src/set/modify.c @@ -13,7 +13,7 @@ bool libcdsb_vset_insert(set_t* x, vtype_variable value) { if (!rbnode_is_empty(n = x->root)) { do { p = n; - cmp = vtype_compare(value.pointer, value.type, vnode_peek(&n->value, value.type), value.type); + cmp = vtype_compare(value.pointer, value.type, vnode_peek(&n->value, x->type), x->type); if (cmp == 0) return false; @@ -50,7 +50,7 @@ bool libcdsb_vset_attach(set_t* x, vtype_variable value) { if (!rbnode_is_empty(n)) { do { p = n; - cmp = vtype_compare(value.pointer, value.type, vnode_peek(&n->value, value.type), value.type); + cmp = vtype_compare(value.pointer, value.type, vnode_peek(&n->value, x->type), x->type); if (cmp == 0) { vnode_free(&vn, value.type);