From f98de4e0a4d955304fe374a5aa3841d0ce2712f8 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Tue, 30 Jan 2024 11:49:25 +0100 Subject: [PATCH] Improve code a little --- inc/ti/fn/fnsetargs.h | 2 +- src/util/imap.c | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/inc/ti/fn/fnsetargs.h b/inc/ti/fn/fnsetargs.h index 23d48f46..87b1ef0f 100644 --- a/inc/ti/fn/fnsetargs.h +++ b/inc/ti/fn/fnsetargs.h @@ -31,8 +31,8 @@ static int do__f_set_args(ti_query_t * query, cleri_node_t * nd, ex_t * e) * No garbage collection safe drop is required as all the possible * things are guaranteed to have Id's. */ - ti_val_unsafe_drop(vec_set(vtask->args, v, idx)); ti_incref(v); + ti_val_unsafe_drop(vec_set(vtask->args, v, idx)); } while (idx < m) diff --git a/src/util/imap.c b/src/util/imap.c index 58750db6..aa1a51eb 100644 --- a/src/util/imap.c +++ b/src/util/imap.c @@ -530,15 +530,14 @@ static _Bool imap__eq(imap_node_t * nodea, imap_node_t * nodeb) return true; } - if (nodea->key != IMAP_NODE_SZ && nodeb->key != IMAP_NODE_SZ) - return false; - if (nodeb->key == IMAP_NODE_SZ) { imap_node_t * tmp = nodea; nodea = nodeb; nodeb = tmp; } + else if (nodea->key != IMAP_NODE_SZ) + return false; /* check if the nodes are equal unless the key's are different */ { @@ -578,9 +577,6 @@ static _Bool imap__le(imap_node_t * nodea, imap_node_t * nodeb) return true; } - if (nodea->key != IMAP_NODE_SZ && nodeb->key != IMAP_NODE_SZ) - return false; - if (nodeb->key == IMAP_NODE_SZ) { imap_node_t @@ -591,7 +587,8 @@ static _Bool imap__le(imap_node_t * nodea, imap_node_t * nodeb) (nda->nodes && !ndb->nodes) || (nda->nodes && !imap__le(nda, ndb))); } - else + + if (nodea->key == IMAP_NODE_SZ) { uint8_t key = 0; imap_node_t @@ -609,6 +606,8 @@ static _Bool imap__le(imap_node_t * nodea, imap_node_t * nodeb) return false; return true; } + + return false; } /*