mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user