Index: base/string_util.cc |
=================================================================== |
--- base/string_util.cc (revision 82422) |
+++ base/string_util.cc (working copy) |
@@ -831,6 +831,7 @@ |
OutStringType DoReplaceStringPlaceholders(const FormatStringType& format_string, |
const std::vector<OutStringType>& subst, std::vector<size_t>* offsets) { |
size_t substitutions = subst.size(); |
+ DCHECK(substitutions < 10); |
size_t sub_length = 0; |
for (typename std::vector<OutStringType>::const_iterator iter = subst.begin(); |
@@ -855,14 +856,7 @@ |
} |
--i; |
} else { |
- uintptr_t index = 0; |
- while ('0' <= *i && '9' >= *i) { |
- index *= 10; |
- index += *i - '0'; |
- ++i; |
- } |
- --i; |
- index -= 1; |
+ uintptr_t index = *i - '1'; |
if (offsets) { |
ReplacementOffset r_offset(index, |
static_cast<int>(formatted.size())); |