Skip to content

Commit 5fd817a

Browse files
committed
Minor bug solved with with set contains.
1 parent 0d7dba5 commit 5fd817a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/adt/source/adt_set.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ static int set_contains_any_cb_iterate(set s, set_key key, set_value value, set_
308308

309309
iterator->result = set_contains(iterator->s, key);
310310

311-
return iterator->result;
311+
/* Stop iteration if we found an element */
312+
return !iterator->result;
312313
}
313314

314315
int set_contains_any(set dest, set src)
@@ -348,7 +349,7 @@ set_value set_remove(set s, set_key key)
348349

349350
if (set_bucket_remove(bucket, s->compare_cb, key, &value) != 0)
350351
{
351-
log_write("metacall", LOG_LEVEL_ERROR, "Invalid set bucket remove");
352+
log_write("metacall", LOG_LEVEL_ERROR, "Invalid set bucket remove: %p", key);
352353

353354
return NULL;
354355
}

0 commit comments

Comments
 (0)