From 10a7ea1e8b7b2eb238349b597844252f1a28c199 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 29 Mar 2016 17:32:08 -0700 Subject: glapi: gl_XML.py: refactor out extra else statement This is a pretty minor refactor, but it avoids having an else statement with a nested if. It instead makes it one big if statement. Signed-off-by: Dylan Baker --- src/mapi/glapi/gen/gl_XML.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index 2ce6e5d75b..561a86f90e 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -273,8 +273,8 @@ def classify_category(name, number): 1. ARB extensions, sorted by extension number. 2. Non-ARB extensions, sorted by extension number. 3. Un-numbered extensions, sorted by extension name. - """ + """ try: core_version = float(name) except (ValueError, TypeError): @@ -286,13 +286,12 @@ def classify_category(name, number): elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"): cat_type = 1 key = int(number) + elif number is not None: + cat_type = 2 + key = int(number) else: - if number != None: - cat_type = 2 - key = int(number) - else: - cat_type = 3 - key = name + cat_type = 3 + key = name return [cat_type, key] -- cgit v1.2.3