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

Unified Diff: base/strings/utf_offset_string_conversions.h

Issue 23619016: Switch the offset conversion routines from... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 3 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
Index: base/strings/utf_offset_string_conversions.h
===================================================================
--- base/strings/utf_offset_string_conversions.h (revision 221015)
+++ base/strings/utf_offset_string_conversions.h (working copy)
@@ -44,14 +44,14 @@
std::vector<size_t>* offsets_for_adjustment);
// Limiting function callable by std::for_each which will replace any value
-// which is equal to or greater than |limit| with npos.
+// which is greater than |limit| with npos.
template <typename T>
struct LimitOffset {
explicit LimitOffset(size_t limit)
: limit_(limit) {}
void operator()(size_t& offset) {
- if (offset >= limit_)
+ if (offset > limit_)
offset = T::npos;
}
« no previous file with comments | « no previous file | base/strings/utf_offset_string_conversions.cc » ('j') | chrome/browser/autocomplete/search_provider_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698