refactor: use std::map::try_emplace()
over std::map::insert()
(#46794)
refactor: prefer std::map::try_emplace() over std::map::insert() 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
5dab95335b
commit
d52670c749
10 changed files with 15 additions and 21 deletions
|
@ -116,8 +116,7 @@ SerialChooserController* ElectronSerialDelegate::AddControllerForFrame(
|
|||
render_frame_host, std::move(filters),
|
||||
std::move(allowed_bluetooth_service_class_ids), 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