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

Unified Diff: ui/accessibility/ax_text_utils.cc

Issue 190033006: Rewriting loop in accessibility code to silence analyzer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Finally rid of .gitmodules Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_text_utils.cc
diff --git a/ui/accessibility/ax_text_utils.cc b/ui/accessibility/ax_text_utils.cc
index 9c5f8feefee839d96df479d4818e9bcc254ef310..08cd562ecd04496d0d577e22512c8e34ed0ba52b 100644
--- a/ui/accessibility/ax_text_utils.cc
+++ b/ui/accessibility/ax_text_utils.cc
@@ -31,12 +31,8 @@ size_t FindAccessibleTextBoundary(const base::string16& text,
}
return text_size;
} else {
- // Note: j is unsigned, so for loop continues until j wraps around
- // and becomes greater than the starting value.
- for (size_t j = line_breaks.size() - 1;
- j < line_breaks.size();
- --j) {
- size_t line_break = line_breaks[j] >= 0 ? line_breaks[j] : 0;
+ for (size_t j = line_breaks.size(); j != 0; --j) {
+ size_t line_break = line_breaks[j - 1] >= 0 ? line_breaks[j - 1] : 0;
if (line_break <= start_offset)
return line_break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698