[Mesa-dev] [RESEND 11/13] anv: use dict.get in anv_entrypoints_gen.py

Dylan Baker dylan at pnwbakers.com
Wed Feb 22 23:36:18 UTC 2017


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 at intel.com>
---
 src/intel/vulkan/anv_entrypoints_gen.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
index e1c5ac6ddf..47e3a4651f 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -296,10 +296,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
 
-- 
2.11.1



More information about the mesa-dev mailing list