perf: avoid redundant map lookup in WebFrameMain
constructor (#46275)
perf: avoid double map lookup in WebFrameMain constructor 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
7a950f09ae
commit
a3ba653bee
1 changed files with 2 additions and 2 deletions
|
@ -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 ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue