Commit eb16d547 authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Chromium LUCI CQ

Replace base::Contains() and find() with one find() call

This CL replaces base::Contains() and find() with one find()
call for the map lookup avoid performing a double map lookup
from |process_mojo_map_| in extensions::RendererStartupHelper.

Bug: 1157200
Change-Id: Ie16f2269fa0ad70d22e81c9f7018a172105b63ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2588671
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836713}
parent 6dd48ab9
......@@ -318,9 +318,10 @@ RendererStartupHelper::BindNewRendererRemote(
mojom::Renderer* RendererStartupHelper::GetRenderer(
content::RenderProcessHost* process) {
if (!base::Contains(process_mojo_map_, process))
auto it = process_mojo_map_.find(process);
if (it == process_mojo_map_.end())
return nullptr;
return process_mojo_map_.find(process)->second.get();
return it->second.get();
}
//////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment