diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2018-06-25 13:42:22 -0700 |
---|---|---|
committer | Rafael Antognolli <[email protected]> | 2018-07-12 14:03:51 -0700 |
commit | fa0c19d17b9b6308fdca01f609c167b3ea1e68ae (patch) | |
tree | f75e9e33e5ccc8766053931cc361d58c948abdf4 /src/util/set.c | |
parent | b034facfbc446b28f2cc92c32122849a25fb1001 (diff) |
util/set: helper to remove entry by key
v2: Add unit test. (Eric Anholt)
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/util/set.c')
-rw-r--r-- | src/util/set.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/set.c b/src/util/set.c index b2aa5ba13d5..feef96d16ea 100644 --- a/src/util/set.c +++ b/src/util/set.c @@ -384,6 +384,15 @@ _mesa_set_remove(struct set *ht, struct set_entry *entry) } /** + * Removes the entry with the corresponding key, if exists. + */ +void +_mesa_set_remove_key(struct set *set, const void *key) +{ + _mesa_set_remove(set, _mesa_set_search(set, key)); +} + +/** * This function is an iterator over the hash table. * * Pass in NULL for the first entry, as in the start of a for loop. Note that |