Improve performance of FindFormControlElementsByUniqueRendererId
Before this CL, FindFormControlElementsByUniqueRendererId did many linear searches over its vector parameter |form_control_renderer_ids|, and accordingly had a DCHECK that the vector doesn't contain more than 10 elements. This CL changes the implementation to build and use a map instead for the lookups, thus avoiding the linear searches, and making FindFormControlElementsByUniqueRendererId appropriate for larger inputs. Bug: 1004777 Change-Id: I0699d87de7202f42269c3504ecf08356ee880601 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899455Reviewed-by:Vadym Doroshenko <dvadym@chromium.org> Commit-Queue: Marc Treib <treib@chromium.org> Cr-Commit-Position: refs/heads/master@{#712552}
Showing
Please register or sign in to comment