anv: use dict.get in anv_entrypoints_gen.py
authorDylan Baker <dylan@pnwbakers.com>
Tue, 21 Feb 2017 19:07:44 +0000 (11:07 -0800)
committerDylan Baker <dylan@pnwbakers.com>
Wed, 22 Mar 2017 23:22:00 +0000 (16:22 -0700)
Instead of using an if and a check, use dict.get, which does the same
thing, but more succinctly.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
src/intel/vulkan/anv_entrypoints_gen.py

index 6b2d4220150678c5eb14a6ac3a5fef7bd245b554..b5bd6f176564dc9ba86b13ef70910d4efcfcfe12 100644 (file)
@@ -295,10 +295,7 @@ def get_entrypoints(doc, entrypoints_to_defines):
         shortname = fullname[2:]
         params = (''.join(p.itertext()) for p in command.findall('./param'))
         params = ', '.join(params)
-        if fullname in entrypoints_to_defines:
-            guard = entrypoints_to_defines[fullname]
-        else:
-            guard = None
+        guard = entrypoints_to_defines.get(fullname)
         entrypoints.append((type, shortname, params, index, cal_hash(fullname), guard))
         index += 1