mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -122,11 +122,9 @@ void UsbChooserController::GotUsbDeviceList(
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
// "select-usb-device" should respect |filters|.
|
||||
devices.erase(std::remove_if(devices.begin(), devices.end(),
|
||||
[this](const auto& device_info) {
|
||||
return !DisplayDevice(*device_info);
|
||||
}),
|
||||
devices.end());
|
||||
std::erase_if(devices, [this](const auto& device_info) {
|
||||
return !DisplayDevice(*device_info);
|
||||
});
|
||||
|
||||
v8::Local<v8::Object> details = gin::DataObjectBuilder(isolate)
|
||||
.Set("deviceList", devices)
|
||||
|
||||
Reference in New Issue
Block a user