From f69c21c8e6971639e90ce32d5b36f32632941086 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 15 Aug 2023 07:21:43 -0700 Subject: [PATCH] Additional none_of conversion (#1113) --- taglib/ape/apetag.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index d7beadf1..04159dae 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -58,14 +58,8 @@ namespace static constexpr std::array invalidKeys { "ID3", "TAG", "OGGS", "MP+" }; // only allow printable ASCII including space (32..126) - - for(auto it = key.begin(); it != key.end(); ++it) { - const int c = static_cast(*it); - if(c < 32 || c > 126) - return false; - } - - return std::none_of(invalidKeys.begin(), invalidKeys.end(), [upperKey = String(key).upper()](auto k) { return upperKey == k; }); + return std::none_of(key.begin(), key.end(), [](unsigned char c) { return c < 32 || c > 126; }) + && std::none_of(invalidKeys.begin(), invalidKeys.end(), [upperKey = String(key).upper()](auto k) { return upperKey == k; }); } } // namespace