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

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.
msw 2013/09/04 23:58:50 I share Will's concern that other callers might ha
Peter Kasting 2013/09/05 20:11:59 See bug 284781 comment 16 for the full description
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;
}

Powered by Google App Engine
This is Rietveld 408576698