From 1c2d6a1fa214b99fbb26af68d8c132d5748ce8ee Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Sun, 2 Apr 2023 22:29:16 +0200 Subject: [PATCH] Small fix --- src/common/utils/info_string.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/utils/info_string.cpp b/src/common/utils/info_string.cpp index 56ed56ab..229d0ef8 100644 --- a/src/common/utils/info_string.cpp +++ b/src/common/utils/info_string.cpp @@ -36,25 +36,25 @@ namespace utils 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) { const auto& key = key_values[i]; 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 { - //auto first = true; std::string info_string; for (const auto& [key, val] : this->key_value_pairs_) { - //if (first) first = false; - /*else*/ info_string.append("\\"); - info_string.append(key); info_string.append("\\"); info_string.append(val);