refactor: use std::erase() (#41881)

* refactor: use std::erase() in WebContentsPreferences::~WebContentsPreferences()

* refactor: use std::erase() in WindowList::RemoveWindow()

* refactor: use std::erase() in ElectronBindings::EnvironmentDestroyed()

* refactor: use std::erase() in CleanedUpAtExit::~CleanedUpAtExit()

* refactor: use std::erase_if() in ElectronBrowserContext::RevokeDevicePermission()

* refactor: use std::erase_if() in UsbChooserController::GotUsbDeviceList()

* refactor: move DoesDeviceMatch() out of class into anonymous namespace
This commit is contained in:
Charles Kerr 2024-04-19 10:55:59 -05:00 committed by GitHub
parent 39bf441b3b
commit 0346e0a8bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 74 additions and 91 deletions

View file

@ -59,8 +59,7 @@ void WindowList::AddWindow(NativeWindow* window) {
// static
void WindowList::RemoveWindow(NativeWindow* window) {
WindowVector& windows = GetInstance()->windows_;
windows.erase(std::remove(windows.begin(), windows.end(), window),
windows.end());
std::erase(windows, window);
for (WindowListObserver& observer : GetObservers())
observer.OnWindowRemoved(window);