[Mesa-dev] [PATCH 2.1/3?] squash! nir_algebraic.py: don't store a dictionary of indexes
eric at anholt.net
Wed Feb 11 18:02:17 PST 2015
Kenneth Graunke <kenneth at whitecape.org> writes:
> Since condition_list is an ordered list, we can just use enumerate()
> when walking through it to get (index, value) pairs, rather than storing
> a second dictionary mapping items to their indices. When looking for an
> existing entry, use list.index() to get the index of that item.
> src/glsl/nir/nir_algebraic.py | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
> Here's my review feedback for this patch. I haven't tested it, but it does
> compile at least. With this squashed in, patches 1-2 of the miniseries are
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Yeah, if we don't have many conditions, the extra python code is
probably not worth it.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 818 bytes
Desc: not available
More information about the mesa-dev