Simplify std::find with Common::Contains

In NandPaths.cpp, the `std::initializer_list<char>` of illegal characters has been turned into a `char[]` (similar to the one in GameList.cpp).

The reverse iteration in ResourcePack.cpp seemed to provide no benefits, and doing without it it seemed to have no ill effects.
This commit is contained in:
mitaclaw 2024-09-20 22:17:29 -07:00 committed by pull[bot]
commit cc16346d8f
16 changed files with 43 additions and 51 deletions

View file

@ -22,6 +22,7 @@
#include "AudioCommon/AudioCommon.h"
#include "Common/Config/Config.h"
#include "Common/Contains.h"
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
@ -297,7 +298,7 @@ void Settings::AddPath(const QString& qpath)
std::string path = qpath.toStdString();
std::vector<std::string> paths = Config::GetIsoPaths();
if (std::find(paths.begin(), paths.end(), path) != paths.end())
if (Common::Contains(paths, path))
return;
paths.emplace_back(path);