mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: prefer std::ranges over begin() and end() (#43464)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -455,8 +455,7 @@ struct Converter<network::mojom::SSLConfigPtr> {
|
||||
!options.Get("disabledCipherSuites", &(*out)->disabled_cipher_suites)) {
|
||||
return false;
|
||||
}
|
||||
std::sort((*out)->disabled_cipher_suites.begin(),
|
||||
(*out)->disabled_cipher_suites.end());
|
||||
std::ranges::sort((*out)->disabled_cipher_suites);
|
||||
|
||||
// TODO(nornagon): also support other SSLConfig properties?
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user