mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
perf: avoid redundant map lookup in UsbChooserContext::OnDeviceRemoved() (#46418)
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:
@@ -302,8 +302,8 @@ void UsbChooserContext::OnDeviceRemoved(
|
||||
}
|
||||
|
||||
// Update the device list.
|
||||
DCHECK(devices_.contains(device_info->guid));
|
||||
devices_.erase(device_info->guid);
|
||||
const size_t n_erased = devices_.erase(device_info->guid);
|
||||
DCHECK_EQ(n_erased, 1U);
|
||||
|
||||
// Notify all device observers.
|
||||
for (auto& observer : device_observer_list_)
|
||||
|
||||
Reference in New Issue
Block a user