Replaced boost::algorithm::join with standard algorithms

Changes based on f0f6f61cab
dev
Tomasz Kapuściński 2023-08-09 19:52:44 +02:00
parent 7d3e3c91e8
commit 32fb105bca
2 changed files with 12 additions and 3 deletions

View File

@ -279,7 +279,10 @@ void CModManager::LoadModData(Mod& mod)
auto major = StrUtils::ToString(line->GetParam("major")->AsInt());
auto minor = StrUtils::ToString(line->GetParam("minor")->AsInt());
auto patch = StrUtils::ToString(line->GetParam("patch")->AsInt());
data.version = boost::algorithm::join(std::vector<std::string>{ major, minor, patch }, ".");
std::ostringstream stream;
stream << major << "." << minor << "." << patch;
data.version = stream.str();
}
}

View File

@ -26,7 +26,7 @@
#include "level/robotmain.h"
#include <algorithm>
#include <boost/algorithm/string/join.hpp>
#include <numeric>
struct ActivePause
{
@ -45,13 +45,19 @@ struct ActivePause
static std::string GetPauseName(PauseType type)
{
std::vector<std::string> x;
if ((type & PAUSE_ENGINE) != 0) x.push_back("engine");
if ((type & PAUSE_HIDE_SHORTCUTS) != 0) x.push_back("hide_shortcuts");
if ((type & PAUSE_PHOTO) != 0) x.push_back("photo");
if ((type & PAUSE_OBJECT_UPDATES) != 0) x.push_back("object_updates");
if ((type & PAUSE_MUTE_SOUND) != 0) x.push_back("mute_sound");
if ((type & PAUSE_CAMERA) != 0) x.push_back("camera");
return boost::algorithm::join(x, "|");
return std::accumulate(x.cbegin(), x.cend(), std::string(),
[](auto& acc, auto& value)
{
return acc.empty() ? value : acc + "|" + value;
});
}
CPauseManager::CPauseManager()