fix: iterate over SO headers instead of values during initialization

This commit is contained in:
Max Luebke 2025-08-07 13:22:34 +02:00
parent 29fbbc657b
commit 8fd537b6a5

View File

@ -12,6 +12,7 @@
#include <cmath> #include <cmath>
#include <cstddef> #include <cstddef>
#include <iterator> #include <iterator>
#include <limits>
#include <map> #include <map>
#include <set> #include <set>
#include <string> #include <string>
@ -234,13 +235,11 @@ void PhreeqcMatrix::initialize() {
const auto &headers = this->_m_selected_output_parser->getHeader(); const auto &headers = this->_m_selected_output_parser->getHeader();
for (std::size_t i = 0; i < selected_output_values.size(); i++) { for (const auto &hdr_str : headers) {
elements.push_back({headers[i], elements.push_back(
PhreeqcMatrix::PhreeqcComponent::SELECTED_OUTPUT, {hdr_str, PhreeqcMatrix::PhreeqcComponent::SELECTED_OUTPUT, 0});
selected_output_values[i]});
base_names.push_back( base_names.push_back(
{PhreeqcMatrix::base_names::Components::SELECTED_OUTPUT, {PhreeqcMatrix::base_names::Components::SELECTED_OUTPUT, hdr_str});
headers[i]});
} }
} }
_m_map[id] = elements; _m_map[id] = elements;