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
|
@ -883,9 +883,9 @@ void ProxyingURLLoaderFactory::OnLoaderForCorsPreflightCreated(
|
|||
// sending request headers is very difficult.
|
||||
const uint64_t web_request_id = ++(*request_id_generator_);
|
||||
|
||||
auto result = requests_.insert(std::make_pair(
|
||||
auto result = requests_.try_emplace(
|
||||
web_request_id, std::make_unique<InProgressRequest>(
|
||||
this, web_request_id, frame_routing_id_, request)));
|
||||
this, web_request_id, frame_routing_id_, request));
|
||||
|
||||
result.first->second->OnLoaderCreated(std::move(receiver));
|
||||
result.first->second->Restart();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue