mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
perf: avoid a double-map lookup in NotificationPresenter::RemoveNotification() (#46338)
perf: avoid a double-map lokup in NotificationPresenter::RemoveNotification()
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user