refactor: prefer std::ranges over begin() and end() (#43482)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-08-26 14:37:56 -04:00 committed by GitHub
parent d55e120038
commit 9a3618e912
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 30 additions and 40 deletions

View file

@ -34,11 +34,9 @@ bool RegisteringMediaKeyForUntrustedClient(const ui::Accelerator& accelerator) {
bool MapHasMediaKeys(
const std::map<ui::Accelerator, base::RepeatingClosure>& accelerator_map) {
auto media_key = std::find_if(
accelerator_map.begin(), accelerator_map.end(),
[](const auto& ac) { return Command::IsMediaKey(ac.first); });
return media_key != accelerator_map.end();
return std::ranges::any_of(accelerator_map, [](const auto& ac) {
return Command::IsMediaKey(ac.first);
});
}
#endif