perf: avoid a double-map lookup in NotificationPresenter::RemoveNotification() (#46338)

perf: avoid a double-map lokup in NotificationPresenter::RemoveNotification()
This commit is contained in:
Charles Kerr 2025-03-28 21:33:11 -05:00 committed by GitHub
parent 49aba471dc
commit 2baa4a3514
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,13 +27,8 @@ base::WeakPtr<Notification> NotificationPresenter::CreateNotification(
}
void NotificationPresenter::RemoveNotification(Notification* notification) {
auto it = notifications_.find(notification);
if (it == notifications_.end()) {
return;
}
notifications_.erase(notification);
delete notification;
if (const auto nh = notifications_.extract(notification))
delete nh.value();
}
void NotificationPresenter::CloseNotificationWithId(