--- src/util/set.c | 9 +++++++++ src/util/set.h | 2 ++ 2 files changed, 11 insertions(+)
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 @@ -383,6 +383,15 @@ _mesa_set_remove(struct set *ht, struct set_entry *entry) ht->deleted_entries++; } +/** + * 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. * diff --git a/src/util/set.h b/src/util/set.h index 4db070a6f10..ffd19a798bd 100644 --- a/src/util/set.h +++ b/src/util/set.h @@ -81,6 +81,8 @@ _mesa_set_search_pre_hashed(const struct set *set, uint32_t hash, void _mesa_set_remove(struct set *set, struct set_entry *entry); +void +_mesa_set_remove_key(struct set *set, const void *key); struct set_entry * _mesa_set_next_entry(const struct set *set, struct set_entry *entry); -- 2.17.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev