refactor: prefer std::ranges over begin() and end() (#43464)
This commit is contained in:
parent
56829f75c1
commit
2390706030
11 changed files with 30 additions and 40 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue