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

This commit is contained in:
Charles Kerr
2024-08-26 09:58:32 -05:00
committed by GitHub
parent 56829f75c1
commit 2390706030
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();