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:
parent
92b03cb91f
commit
7299dd1501
1 changed files with 2 additions and 2 deletions
|
@ -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_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue