Merge pull request #12096 from Dentomologist/nandpaths_resolve_android_warning

NandPaths: Resolve Android tautological comparison warning
This commit is contained in:
Admiral H. Curtiss
2023-08-15 22:23:57 +02:00
committed by GitHub

View File

@ -5,7 +5,6 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <unordered_set>
#include <vector> #include <vector>
#include <fmt/format.h> #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 bool IsIllegalCharacter(char c)
{ {
static const std::unordered_set<char> illegal_chars = {'\"', '*', '/', ':', '<', static constexpr auto illegal_chars = {'\"', '*', '/', ':', '<', '>', '?', '\\', '|', '\x7f'};
'>', '?', '\\', '|', '\x7f'}; return static_cast<unsigned char>(c) <= 0x1F ||
return (c >= 0 && c <= 0x1F) || illegal_chars.find(c) != illegal_chars.end(); std::find(illegal_chars.begin(), illegal_chars.end(), c) != illegal_chars.end();
} }
std::string EscapeFileName(const std::string& filename) std::string EscapeFileName(const std::string& filename)