util: Add foreach_reverse for dynarray
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 12 Sep 2018 21:57:35 +0000 (14:57 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 16 Oct 2018 00:29:46 +0000 (17:29 -0700)
commit3966f053a14c5f1c57738143fea3d239070e5517
tree923dd79c34c46b37b7ad9fb4224c17c67e82ff67
parent8ec83dc51e407fa0987d636752497509278c0dbb
util: Add foreach_reverse for dynarray

Useful to walk the array removing elements by swapping them with the
last element.

v2: Change iteration to make sure we never underflow. (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/util/u_dynarray.h