Skip to content

Commit

Permalink
For loop is running un-nacessrily after match.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
deepak.m1 authored and Commit bot committed Sep 29, 2014
1 parent af8a405 commit 0c4d9f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pdf/pdfium/pdfium_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 0c4d9f7

Please sign in to comment.