mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Reapply fmt::merge change
This commit is contained in:
parent
7a61fd3055
commit
0506bf0352
1 changed files with 6 additions and 3 deletions
|
@ -137,14 +137,17 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
|
||||||
|
|
||||||
std::string fmt::merge(std::vector<std::string> source, const std::string& separator)
|
std::string fmt::merge(std::vector<std::string> source, const std::string& separator)
|
||||||
{
|
{
|
||||||
|
if (!source.size())
|
||||||
|
return "";
|
||||||
|
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|
||||||
for (auto &s : source)
|
for (int i = 0; i < source.size() - 1; ++i)
|
||||||
{
|
{
|
||||||
result += s + separator;
|
result += source[i] + separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result + source[source.size() - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fmt::merge(std::initializer_list<std::vector<std::string>> sources, const std::string& separator)
|
std::string fmt::merge(std::initializer_list<std::vector<std::string>> sources, const std::string& separator)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue