perf: avoid a double-map lookup in NotificationPresenter::RemoveNotification()
(#46354)
perf: avoid a double-map lokup in NotificationPresenter::RemoveNotification() 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:
parent
b647c8935d
commit
45c78deff8
1 changed files with 2 additions and 7 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue