Commit ac4e69fbc9b15eb4f36baa8a21c92ba3afe81cc8

Stefan Sperling 2018-06-22T02:02:49

undo previous; this approach won't work

diff --git a/lib/object_idset.c b/lib/object_idset.c
index 1bd4278..ae64f9a 100644
--- a/lib/object_idset.c
+++ b/lib/object_idset.c
@@ -165,18 +165,13 @@ got_object_idset_remove(struct got_object_idset *set,
     struct got_object_id *id)
 {
 	struct got_object_idset_element *entry, *tmp;
-	uint8_t i;
-
-	if (id)
-		i = id->sha1[0];
-	else
-		i = arc4random_uniform(nitems(set->entries));
+	uint8_t i = id->sha1[0];
 
 	if (set->nelem == 0)
 		return got_error(GOT_ERR_NO_OBJ);
 
 	TAILQ_FOREACH_SAFE(entry, &set->entries[i], entry, tmp) {
-		if (id == NULL || got_object_id_cmp(&entry->id, id) == 0) {
+		if (got_object_id_cmp(&entry->id, id) == 0) {
 			TAILQ_REMOVE(&set->entries[i], entry, entry);
 			set->nelem--;
 			return NULL;