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

@ -38,10 +38,10 @@ void NotificationPresenter::RemoveNotification(Notification* notification) {
void NotificationPresenter::CloseNotificationWithId(
const std::string& notification_id) {
auto it = std::find_if(notifications_.begin(), notifications_.end(),
[&notification_id](const Notification* n) {
return n->notification_id() == notification_id;
});
auto it = std::ranges::find_if(
notifications_, [&notification_id](const Notification* n) {
return n->notification_id() == notification_id;
});
if (it != notifications_.end()) {
Notification* notification = (*it);
notification->Dismiss();