From 3e860c26d3b481184d59f7df374f5502109211dc Mon Sep 17 00:00:00 2001 From: Gregory Lirent Date: Thu, 23 Mar 2023 19:30:06 +0300 Subject: [PATCH] Fix modifying of dict --- src/dict/modify.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dict/modify.c b/src/dict/modify.c index 9d08bcc..75c511b 100644 --- a/src/dict/modify.c +++ b/src/dict/modify.c @@ -60,8 +60,8 @@ bool libcdsb_dict_update(dict_t* x, vtype_variable key, vtype_variable value, vo while (!is_null(c)) { if (vtype_compare(key.pointer, key.type, vnode_peek(&c->key, c->key_type), c->key_type) == 0) { - if (!callback) callback(libcdsb_variable_build(vnode_peek(&c->key, c->key_type), c->key_type), - libcdsb_variable_build(vnode_peek(&c->value, c->value_type), c->value_type), dt); + if (callback) callback(libcdsb_variable_build(vnode_peek(&c->key, c->key_type), c->key_type), + libcdsb_variable_build(vnode_peek(&c->value, c->value_type), c->value_type), dt); vnode_free(&c->value, c->value_type); @@ -94,8 +94,8 @@ bool libcdsb_dict_inject(dict_t* x, vtype_variable key, vtype_variable value, vo while (!is_null(c)) { if (vtype_compare(key.pointer, key.type, vnode_peek(&c->key, c->key_type), c->key_type) == 0) { - if (!callback) callback(libcdsb_variable_build(vnode_peek(&c->key, c->key_type), c->key_type), - libcdsb_variable_build(vnode_peek(&c->value, c->value_type), c->value_type), dt); + if (callback) callback(libcdsb_variable_build(vnode_peek(&c->key, c->key_type), c->key_type), + libcdsb_variable_build(vnode_peek(&c->value, c->value_type), c->value_type), dt); vnode_free(&c->key, c->key_type); vnode_free(&c->value, c->value_type);