maint(info_string): small fix

This commit is contained in:
Diavolo 2023-05-26 16:20:43 +02:00
parent 2b008c31a5
commit 2b468a24cb
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
3 changed files with 12 additions and 9 deletions

View File

@ -58,11 +58,11 @@ filter {}
filter {"language:C++", "toolset:not msc*"}
buildoptions {
"-std=c++17"
"-std=c++20"
}
filter "toolset:msc*"
buildoptions {
"/std:c++17"
"/std:c++20"
}
filter {}

View File

@ -31,10 +31,12 @@
#endif
#include <cassert>
#include <cctype>
#include <csignal>
#include <cstdarg>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <atomic>

View File

@ -43,23 +43,24 @@ namespace utils
{
const auto& key = key_values[i];
const auto& value = key_values[i + 1];
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 (auto i = this->key_value_pairs_.begin(); i != this->key_value_pairs_.end(); ++i)
for (const auto& [key, val] : this->key_value_pairs_)
{
//if (first) first = false;
/*else*/
info_string.append("\\");
info_string.append(i->first); // Key
info_string.append(key);
info_string.append("\\");
info_string.append(i->second); // Value
info_string.append(val);
}
return info_string;