scripts: Avoid duplicates in enum string helper
authorMark Lobodzinski <mark@lunarg.com>
Thu, 28 Sep 2017 21:12:02 +0000 (15:12 -0600)
committerMike Schuchardt <mikes@lunarg.com>
Fri, 9 Mar 2018 20:54:31 +0000 (13:54 -0700)
scripts/helper_file_generator.py

index ba885558e24f5cecdc4e6d5e3f906d2bbf639b1b..6f2ea4b6940e251c2b109d6a74e331d6cf2db9f7 100644 (file)
@@ -185,7 +185,9 @@ class HelperFileOutputGenerator(OutputGenerator):
             for elem in groupElem.findall('enum'):
                 if elem.get('supported') != 'disabled':
                     item_name = elem.get('name')
-                    value_list.append(item_name)
+                    # Avoid duplicates
+                    if item_name not in value_list:
+                        value_list.append(item_name)
             if value_list is not None:
                 self.enum_output += self.GenerateEnumStringConversion(groupName, value_list)
         elif self.helper_file_type == 'object_types_header':