[AdTagging] Optimize IsAdScriptInStack
When scanning the stack we're really just checking if any element in the vector is true. We can replace this O(n) check with O(1) if we keep track of the number of true elements in the vector. Bug: 894505 Change-Id: I378cffe80212277a7fa8ad414e15a5cf3c9824c8 Reviewed-on: https://chromium-review.googlesource.com/c/1289329 Commit-Queue: Josh Karlin <jkarlin@chromium.org> Reviewed-by:Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#601002}
Showing
Please register or sign in to comment