Small fix

This commit is contained in:
fed 2023-04-02 22:29:16 +02:00
parent d721a20d3e
commit 1c2d6a1fa2

View File

@ -36,25 +36,25 @@ namespace utils
buffer = buffer.substr(1); buffer = buffer.substr(1);
} }
auto key_values = string::split(buffer, '\\'); const auto key_values = string::split(buffer, '\\');
for (size_t i = 0; !key_values.empty() && i < (key_values.size() - 1); i += 2) for (size_t i = 0; !key_values.empty() && i < (key_values.size() - 1); i += 2)
{ {
const auto& key = key_values[i]; const auto& key = key_values[i];
const auto& value = key_values[i + 1]; const auto& value = key_values[i + 1];
this->key_value_pairs_[key] = value;
if (!this->key_value_pairs_.contains(key))
{
this->key_value_pairs_[key] = value;
}
} }
} }
std::string info_string::build() const std::string info_string::build() const
{ {
//auto first = true;
std::string info_string; std::string info_string;
for (const auto& [key, val] : this->key_value_pairs_) for (const auto& [key, val] : this->key_value_pairs_)
{ {
//if (first) first = false;
/*else*/
info_string.append("\\"); info_string.append("\\");
info_string.append(key); info_string.append(key);
info_string.append("\\"); info_string.append("\\");
info_string.append(val); info_string.append(val);