Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12096 from Dentomologist/nandpaths_resolve_androi…
…d_warning

NandPaths: Resolve Android tautological comparison warning
  • Loading branch information
AdmiralCurtiss committed Aug 15, 2023
2 parents 2cbc1e6 + 9ad0d9c commit a446066
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Source/Core/Common/NandPaths.cpp
Expand Up @@ -5,7 +5,6 @@

#include <algorithm>
#include <string>
#include <unordered_set>
#include <vector>

#include <fmt/format.h>
Expand Down Expand Up @@ -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 (c >= 0 && 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)
Expand Down

0 comments on commit a446066

Please sign in to comment.