summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2016-03-29 13:26:13 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2016-03-31 16:03:58 -0700
commit27ab1f4172f54bff477d13cbdb13ee783737cbe7 (patch)
tree0908bd572dafb14a0ef1ff69c9a76388d7d3bc0a
parenta29bd0b966210ed5c4b8610e4170a09de7d5e18d (diff)
glapi: gl_XML.py: simplify gl_api.functionIterateByOffset
Use the max function and a generator expression instead of a loop and if. This is certainly no less efficient, and saves several lines of code. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r--src/mapi/glapi/gen/gl_XML.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index b7178d6e85..f96e44a5a2 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -938,10 +938,7 @@ class gl_api(object):
return iter(functions)
def functionIterateByOffset(self):
- max_offset = -1
- for func in self.functions_by_name.itervalues():
- if func.offset > max_offset:
- max_offset = func.offset
+ max_offset = max(f.offset for f in self.functions_by_name.itervalues())
temp = [None for i in range(max_offset + 1)]
for func in self.functions_by_name.itervalues():