Chromium Code Reviews| Index: tools/json_schema_compiler/cpp_util.py |
| diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py |
| index 2de42293fba9c4b444978f64292ced4153f986e5..1a347c71eb74f21b08f3f7f8b2a26cc832ce4d68 100644 |
| --- a/tools/json_schema_compiler/cpp_util.py |
| +++ b/tools/json_schema_compiler/cpp_util.py |
| @@ -24,6 +24,10 @@ GENERATED_BUNDLE_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITIONS IN |
| // %s |
| // DO NOT EDIT. |
| """ |
| +GENERATED_FEATURE_MESSAGE = """// GENERATED FROM THE FEATURE DEFINITIONS IN |
| +// %s |
| +// DO NOT EDIT. |
| +""" |
| def Classname(s): |
| """Translates a namespace name or function name into something more |
| @@ -111,3 +115,10 @@ def CloseNamespace(namespace): |
| for component in reversed(namespace.split('::')): |
| c.Append('} // namespace %s' % component) |
| return c |
| + |
| +def RemoveFeatureDuplicates(feature_list): |
| + """Return a "set" of features where any feature with the same name is tossed. |
|
not at google - send to devlin
2013/09/12 16:20:43
this method returns a list not a set.
dhnishi (use Chromium)
2013/09/13 17:36:42
Done.
|
| + """ |
| + feature_set = set() |
| + return [feature for feature in feature_list if feature.name not in |
| + feature_set and not feature_set.add(feature.name)] |