Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Issue 2915373002: Refactor SpellCheckMarkerListImpl::Add() (Closed)

Created:
3 years, 6 months ago by rlanday
Modified:
3 years, 6 months ago
Reviewers:
yosin_UTC9, Xiaocheng
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor 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& #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -14 lines) Patch
M third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp View 1 1 chunk +29 lines, -14 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
rlanday
3 years, 6 months ago (2017-06-02 22:23:17 UTC) #2
Xiaocheng
https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp (right): https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp#newcode33 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp:33: if (marker->EndOffset() < (*first_overlapping)->StartOffset()) { We should also go ...
3 years, 6 months ago (2017-06-03 03:17:31 UTC) #3
rlanday
https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp (right): https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp#newcode33 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp:33: if (marker->EndOffset() < (*first_overlapping)->StartOffset()) { On 2017/06/03 at 03:17:31, ...
3 years, 6 months ago (2017-06-03 15:02:03 UTC) #4
Xiaocheng
lgtm https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp (right): https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp#newcode33 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp:33: if (marker->EndOffset() < (*first_overlapping)->StartOffset()) { On 2017/06/03 at ...
3 years, 6 months ago (2017-06-03 19:00:40 UTC) #5
yosin_UTC9
lgtm % nits https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp (right): https://codereview.chromium.org/2915373002/diff/1/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp#newcode24 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp:24: auto first_overlapping = std::lower_bound( nit: s/auto/const ...
3 years, 6 months ago (2017-06-05 02:28:56 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2915373002/20001
3 years, 6 months ago (2017-06-05 17:12:03 UTC) #9
commit-bot: I haz the power
3 years, 6 months ago (2017-06-05 19:12:26 UTC) #12
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/f1a451ab5d6f0a8ec7c3e389fb61...

Powered by Google App Engine
This is Rietveld 408576698