summaryrefslogtreecommitdiff
path: root/lib/mesa/src/util/set.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-11-02 04:53:47 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-11-02 04:53:47 +0000
commitb44518130b33cadb5c1d619e9e936ae0e0dbf7cb (patch)
tree6069eb03c39fbc79808a7d94f857118cce75cbe3 /lib/mesa/src/util/set.c
parent32aeb3c41fedbbd7b11aacfec48e8f699d16bff0 (diff)
Merge Mesa 23.1.9
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.
*/