mirror of
https://github.com/alterware/master-server.git
synced 2025-06-27 06:41:53 +00:00
maint(info_string): small fix
This commit is contained in:
@ -31,10 +31,12 @@
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <csignal>
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
#include <atomic>
|
||||
|
@ -43,23 +43,24 @@ namespace utils
|
||||
{
|
||||
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 (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;
|
||||
|
Reference in New Issue
Block a user