mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Additional none_of conversion (#1113)
This commit is contained in:
parent
574604765f
commit
f69c21c8e6
@ -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<unsigned char>(*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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user