mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
perf: avoid redundant map lookup in WebFrameMain constructor (#46238)
perf: avoid double map lookup in WebFrameMain constructor
This commit is contained in:
@@ -155,8 +155,8 @@ WebFrameMain::WebFrameMain(content::RenderFrameHost* rfh)
|
||||
if (!render_frame_detached_)
|
||||
GetFrameTreeNodeIdMap().emplace(frame_tree_node_id_, this);
|
||||
|
||||
DCHECK(!GetFrameTokenMap().contains(frame_token_));
|
||||
GetFrameTokenMap().emplace(frame_token_, this);
|
||||
const auto [_, inserted] = GetFrameTokenMap().emplace(frame_token_, this);
|
||||
DCHECK(inserted);
|
||||
|
||||
// WebFrameMain should only be created for active or unloading frames.
|
||||
DCHECK(GetLifecycleState(rfh) == LifecycleState::kActive ||
|
||||
|
||||
Reference in New Issue
Block a user