NandPaths: Use initializer_list instead of unordered_set
This commit is contained in:
parent
9955a06dbd
commit
9ad0d9ca6a
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
@ -105,9 +104,9 @@ bool IsTitlePath(const std::string& path, std::optional<FromWhichRoot> from, u64
|
|||
|
||||
static bool IsIllegalCharacter(char c)
|
||||
{
|
||||
static const std::unordered_set<char> illegal_chars = {'\"', '*', '/', ':', '<',
|
||||
'>', '?', '\\', '|', '\x7f'};
|
||||
return static_cast<unsigned char>(c) <= 0x1F || illegal_chars.find(c) != illegal_chars.end();
|
||||
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();
|
||||
}
|
||||
|
||||
std::string EscapeFileName(const std::string& filename)
|
||||
|
|
Loading…
Reference in New Issue