DescriptionRefactor SpellCheckMarkerListImpl::Add()
Currently, the way this method inserts markers (except for the case where we
can insert at the end of the list) is inefficient. Its runtime is quadratic in
the number of markers being merged. We can make this more efficient by binary
searching for both the start and end of the overlapped range, and then erasing
the whole range (minus one marker, which we swap with the newly-inserted marker)
in one go. This method should now always run in time no worse than linear in the
number of markers.
BUG=707867
Review-Url: https://codereview.chromium.org/2915373002
Cr-Commit-Position: refs/heads/master@{#477051}
Committed: https://chromium.googlesource.com/chromium/src/+/f1a451ab5d6f0a8ec7c3e389fb61c34f363768c4
Patch Set 1 #
Total comments: 7
Patch Set 2 : const auto& #Messages
Total messages: 12 (5 generated)
|