mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
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:
@ -11,6 +11,7 @@
|
||||
#include <fmt/ranges.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Contains.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
@ -105,9 +106,8 @@ bool IsTitlePath(const std::string& path, std::optional<FromWhichRoot> from, u64
|
||||
|
||||
static bool IsIllegalCharacter(char c)
|
||||
{
|
||||
static constexpr auto illegal_chars = {'\"', '*', '/', ':', '<', '>', '?', '\\', '|', '\x7f'};
|
||||
return static_cast<unsigned char>(c) <= 0x1F ||
|
||||
std::find(illegal_chars.begin(), illegal_chars.end(), c) != illegal_chars.end();
|
||||
static constexpr char illegal_chars[] = {'\"', '*', '/', ':', '<', '>', '?', '\\', '|', '\x7f'};
|
||||
return static_cast<unsigned char>(c) <= 0x1F || Common::Contains(illegal_chars, c);
|
||||
}
|
||||
|
||||
std::string EscapeFileName(const std::string& filename)
|
||||
|
Reference in New Issue
Block a user