util/set: Add a _mesa_set_search_or_add() function
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 27 Mar 2019 11:00:54 +0000 (12:00 +0100)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 31 May 2019 17:13:45 +0000 (19:13 +0200)
commit8a838e172f3f796b2d5d01cb51e05b37ae6f48f5
tree665ab3631440346c62107ea29da55e6fec91f61c
parent1db86d8b62860380c34af77ae62b019ed2376443
util/set: Add a _mesa_set_search_or_add() function

Unlike _mesa_set_search_and_add(), it doesn't replace an entry if it's
found, returning it instead. This is useful for nir_instr_set, where
we have to know both the original original instruction and its
equivalent.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
src/util/set.c
src/util/set.h
src/util/tests/set/set_test.cpp