Skip to content

Commit

Permalink
Improve code a little
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Jan 30, 2024
1 parent 0ed0eab commit f98de4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion inc/ti/fn/fnsetargs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 6 additions & 7 deletions src/util/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
{
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -609,6 +606,8 @@ static _Bool imap__le(imap_node_t * nodea, imap_node_t * nodeb)
return false;
return true;
}

return false;
}

/*
Expand Down

0 comments on commit f98de4e

Please sign in to comment.