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

Unified Diff: base/i18n/break_iterator.cc

Issue 7008005: base/i18n: Pass |str| as const reference in BreakIterator::Init(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const reference Created 9 years, 7 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 | « base/i18n/break_iterator.h ('k') | base/i18n/break_iterator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/break_iterator.cc
diff --git a/base/i18n/break_iterator.cc b/base/i18n/break_iterator.cc
index 118600a4812d1c943c5f91f1f008f6e7dda8f011..224bb51d79c7b3abc84ea325214d99a2b275cbd8 100644
--- a/base/i18n/break_iterator.cc
+++ b/base/i18n/break_iterator.cc
@@ -14,7 +14,7 @@ namespace i18n {
const size_t npos = -1;
-BreakIterator::BreakIterator(const string16* str, BreakType break_type)
+BreakIterator::BreakIterator(const string16& str, BreakType break_type)
: iter_(NULL),
string_(str),
break_type_(break_type),
@@ -43,7 +43,7 @@ bool BreakIterator::Init() {
return false;
}
iter_ = ubrk_open(break_type, NULL,
- string_->data(), static_cast<int32_t>(string_->size()),
+ string_.data(), static_cast<int32_t>(string_.size()),
&status);
if (U_FAILURE(status)) {
NOTREACHED() << "ubrk_open failed";
@@ -96,7 +96,7 @@ bool BreakIterator::IsWord() const {
string16 BreakIterator::GetString() const {
DCHECK(prev_ != npos && pos_ != npos);
- return string_->substr(prev_, pos_ - prev_);
+ return string_.substr(prev_, pos_ - prev_);
}
} // namespace i18n
« no previous file with comments | « base/i18n/break_iterator.h ('k') | base/i18n/break_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698