0

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:
deepak.m1
2014-09-28 21:38:40 -07:00
committed by Commit bot
parent af8a4054ea
commit 0c4d9f76e8

@ -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;
}
}
}