refactor: use std::map::try_emplace()
over std::map::insert()
(#46761)
refactor: prefer std::map::try_emplace() over std::map::insert()
This commit is contained in:
parent
8fa7d324d1
commit
b40b4dc015
10 changed files with 15 additions and 21 deletions
|
@ -299,8 +299,7 @@ UsbChooserController* ElectronUsbDelegate::AddControllerForFrame(
|
|||
auto controller = std::make_unique<UsbChooserController>(
|
||||
render_frame_host, std::move(options), std::move(callback), web_contents,
|
||||
weak_factory_.GetWeakPtr());
|
||||
controller_map_.insert(
|
||||
std::make_pair(render_frame_host, std::move(controller)));
|
||||
controller_map_.try_emplace(render_frame_host, std::move(controller));
|
||||
return ControllerForFrame(render_frame_host);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue