summaryrefslogtreecommitdiff
path: root/Source/Core/Common/NandPaths.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2024-12-26 16:51:53 -0500
committerGitHub <noreply@github.com>2024-12-26 16:51:53 -0500
commit532a8621daa5c0d8a3a55f64ffba9cb20209d455 (patch)
tree21837ec63b1fe4a45a162a1f1bf4167efcd4d177 /Source/Core/Common/NandPaths.cpp
parentf9ce2b9d764014ab59cf2c19e49c2c848604e6fc (diff)
parent2b0cd16c8c266bc1e298e49d4009eab8c9c23f99 (diff)
Merge pull request #13116 from mitaclaw/ranges-modernization-8-trivial-of
Ranges Algorithms Modernization - Of
Diffstat (limited to 'Source/Core/Common/NandPaths.cpp')
-rw-r--r--Source/Core/Common/NandPaths.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp
index 789fc66b1f..65d18d0c70 100644
--- a/Source/Core/Common/NandPaths.cpp
+++ b/Source/Core/Common/NandPaths.cpp
@@ -113,7 +113,7 @@ static bool IsIllegalCharacter(char c)
std::string EscapeFileName(const std::string& filename)
{
// Prevent paths from containing special names like ., .., ..., ...., and so on
- if (std::all_of(filename.begin(), filename.end(), [](char c) { return c == '.'; }))
+ if (std::ranges::all_of(filename, [](char c) { return c == '.'; }))
return ReplaceAll(filename, ".", "__2e__");
// Escape all double underscores since we will use double underscores for our escape sequences
@@ -170,8 +170,7 @@ std::string UnescapeFileName(const std::string& filename)
bool IsFileNameSafe(const std::string_view filename)
{
- return !filename.empty() &&
- !std::all_of(filename.begin(), filename.end(), [](char c) { return c == '.'; }) &&
- std::none_of(filename.begin(), filename.end(), IsIllegalCharacter);
+ return !filename.empty() && !std::ranges::all_of(filename, [](char c) { return c == '.'; }) &&
+ std::ranges::none_of(filename, IsIllegalCharacter);
}
} // namespace Common