[Mesa-dev] [PATCH 22/41] glapi: gl_XML.py: convert gl_api.functionIterateByOffset to a generator

Dylan Baker baker.dylan.c at gmail.com
Fri Apr 1 19:01:45 UTC 2016


Quoting Ilia Mirkin (2016-04-01 11:47:49)
> On Fri, Apr 1, 2016 at 2:41 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> > Quoting Ilia Mirkin (2016-04-01 08:46:19)
> >
> > Something like this(?):
> >
> > temp = [(f.offset, f) for f in self.functions_by_name.itervalues()
> >         if f.offset != -1]
> > return (func for _, func in sorted(temp))
> 
> And this has the nice advantage of not creating a dict for no reason.
> There's the hypothetical issue of 2 functions having the same offset,
> but... I don't think that's possible in practice.

I would hope that it would cause regressions in piglit if there was such a
collision.

At least either way it's not a change in the generator behavior, since
none of the implementations (the original, the one I sent to the list,
yours, or either of two I proposed) would be robust against that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160401/1a95af7b/attachment-0001.sig>


More information about the mesa-dev mailing list