| Index: tools/json_schema_compiler/util_cc_helper.py
|
| diff --git a/tools/json_schema_compiler/util_cc_helper.py b/tools/json_schema_compiler/util_cc_helper.py
|
| index ee5d6f55baa837e3f88e6f57c627bb508ea7e515..c3acd5fa1d1ac4d9da3e5f52dd1693cd3672b5a0 100644
|
| --- a/tools/json_schema_compiler/util_cc_helper.py
|
| +++ b/tools/json_schema_compiler/util_cc_helper.py
|
| @@ -18,15 +18,12 @@ class UtilCCHelper(object):
|
| src: ListValue*
|
| dst: std::vector or scoped_ptr<std::vector>
|
| """
|
| - if optional:
|
| - val = '%(namespace)s::PopulateOptionalArrayFromList(*%(src)s, &%(dst)s)'
|
| - else:
|
| - val = '%(namespace)s::PopulateArrayFromList(*%(src)s, &%(dst)s)'
|
| - return val % {
|
| - 'namespace': _API_UTIL_NAMESPACE,
|
| - 'src': src,
|
| - 'dst': dst
|
| - }
|
| + populate_list_fn = ('PopulateOptionalArrayFromList' if optional
|
| + else 'PopulateArrayFromList')
|
| + return ('%s::%s(*%s, &%s)') % (_API_UTIL_NAMESPACE,
|
| + populate_list_fn,
|
| + src,
|
| + dst)
|
|
|
| def CreateValueFromArray(self, src, optional):
|
| """Generates code to create a scoped_pt<Value> from the array at src.
|
|
|