summaryrefslogtreecommitdiff
path: root/lib/mesa/src/util/set.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/util/set.c')
-rw-r--r--lib/mesa/src/util/set.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/mesa/src/util/set.c b/lib/mesa/src/util/set.c
index 2a3c16658..dc8371463 100644
--- a/lib/mesa/src/util/set.c
+++ b/lib/mesa/src/util/set.c
@@ -604,33 +604,6 @@ _mesa_set_next_entry(const struct set *ht, struct set_entry *entry)
return NULL;
}
-struct set_entry *
-_mesa_set_random_entry(struct set *ht,
- int (*predicate)(struct set_entry *entry))
-{
- struct set_entry *entry;
- uint32_t i = rand() % ht->size;
-
- if (ht->entries == 0)
- return NULL;
-
- for (entry = ht->table + i; entry != ht->table + ht->size; entry++) {
- if (entry_is_present(entry) &&
- (!predicate || predicate(entry))) {
- return entry;
- }
- }
-
- for (entry = ht->table; entry != ht->table + i; entry++) {
- if (entry_is_present(entry) &&
- (!predicate || predicate(entry))) {
- return entry;
- }
- }
-
- return NULL;
-}
-
/**
* Helper to create a set with pointer keys.
*/