From b7b0b6aa96dfc9f7e76dfa04dc06e4e84678456e Mon Sep 17 00:00:00 2001 From: klingbolt Date: Fri, 7 Jul 2023 19:57:47 -0400 Subject: [PATCH] Changed from using a element in an array to the element itself --- xml_converter/generators/cpp_templates/compoundvalue.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xml_converter/generators/cpp_templates/compoundvalue.cpp b/xml_converter/generators/cpp_templates/compoundvalue.cpp index 20ff8247..3480fe65 100644 --- a/xml_converter/generators/cpp_templates/compoundvalue.cpp +++ b/xml_converter/generators/cpp_templates/compoundvalue.cpp @@ -22,7 +22,7 @@ using namespace std; compound_values = split(get_attribute_value(input), ","); if (compound_values.size() == {{ attribute_variables|length }}) { {% for n, attribute_variable in enumerate(attribute_variables) %} - {{attribute_name}}.{{attribute_variables[n].attribute_name}} = std::stof(compound_values[{{n}}]); + {{attribute_name}}.{{attribute_variable.attribute_name}} = std::stof(compound_values[{{n}}]); {% endfor %} } return {{attribute_name}}; @@ -32,11 +32,11 @@ using namespace std; string stringify_{{attribute_name}}({{class_name}} attribute_value) { string output; {% for n, attribute_variable in enumerate(attribute_variables) %} - {% if attribute_variables[n].attribute_name in xml_bundled_components %} + {% if attribute_variable.attribute_name in xml_bundled_components %} {% if n == 0: %} - output = to_string(attribute_value.{{attribute_variables[n].attribute_name}}); + output = to_string(attribute_value.{{attribute_variable.attribute_name}}); {% else %} - output = output + "," + to_string(attribute_value.{{attribute_variables[n].attribute_name}}); + output = output + "," + to_string(attribute_value.{{attribute_variable.attribute_name}}); {% endif %} {% endif %} {% endfor %}