summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2016-03-30 16:30:27 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2016-03-31 16:03:59 -0700
commit70f5c91763596edf35c5b11f46cfedf8eec290df (patch)
treedc187582c74dc03d9c35b9fee4e6df0c185f55db
parent7e01d504c7fe5df2c1c8a2eab5518280f778e8f5 (diff)
glapi: gl_x86_asm.py: simplify method with sum and generator
Rather than using a loop, and augmenting a variable use a generator and sum to achieve the same result. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r--src/mapi/glapi/gen/gl_x86_asm.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
index f2825cfa28..320d825013 100644
--- a/src/mapi/glapi/gen/gl_x86_asm.py
+++ b/src/mapi/glapi/gen/gl_x86_asm.py
@@ -46,14 +46,8 @@ class PrintGenericStubs(gl_XML.gl_print_base):
"BRIAN PAUL, IBM")
def get_stack_size(self, f):
- size = 0
- for p in f.parameterIterator():
- if p.is_padding:
- continue
-
- size += p.get_stack_size()
-
- return size
+ return sum(p.get_stack_size() for p in f.parameterIterator()
+ if not p.is_padding)
def printRealHeader(self):
print '#include "x86/assyntax.h"'