For loop is running un-nacessrily after match.
loop should break after match as values are getting reset to empty rect after match.Changes done so that loop breaks after match. BUG=417621 Review URL: https://codereview.chromium.org/603903002 Cr-Commit-Position: refs/heads/master@{#297138}
This commit is contained in:
@ -2715,10 +2715,12 @@ PDFiumEngine::SelectionChangeInvalidator::~SelectionChangeInvalidator() {
|
||||
GetVisibleSelectionsScreenRects(&new_selections);
|
||||
for (size_t i = 0; i < new_selections.size(); ++i) {
|
||||
for (size_t j = 0; j < old_selections_.size(); ++j) {
|
||||
if (new_selections[i] == old_selections_[j]) {
|
||||
if (!old_selections_[j].IsEmpty() &&
|
||||
new_selections[i] == old_selections_[j]) {
|
||||
// Rectangle was selected before and after, so no need to invalidate it.
|
||||
// Mark the rectangles by setting them to empty.
|
||||
new_selections[i] = old_selections_[j] = pp::Rect();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user