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

Unified Diff: base/i18n/break_iterator.cc

Issue 6979019: base/i18n: Make BreakIterator::IsWord() more readable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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') | no next file » | 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 224bb51d79c7b3abc84ea325214d99a2b275cbd8..afa1fd80d89b080a97a0585351b1be0b6daacd71 100644
--- a/base/i18n/break_iterator.cc
+++ b/base/i18n/break_iterator.cc
@@ -71,9 +71,8 @@ bool BreakIterator::Advance() {
case BREAK_NEWLINE:
do {
pos = ubrk_next(static_cast<UBreakIterator*>(iter_));
- if (pos == UBRK_DONE) {
+ if (pos == UBRK_DONE)
break;
- }
pos_ = static_cast<size_t>(pos);
status = ubrk_getRuleStatus(static_cast<UBreakIterator*>(iter_));
} while (status >= UBRK_LINE_SOFT && status < UBRK_LINE_SOFT_LIMIT);
@@ -89,9 +88,8 @@ bool BreakIterator::Advance() {
}
bool BreakIterator::IsWord() const {
- return (break_type_ == BREAK_WORD &&
- ubrk_getRuleStatus(static_cast<UBreakIterator*>(iter_)) !=
- UBRK_WORD_NONE);
+ int32_t status = ubrk_getRuleStatus(static_cast<UBreakIterator*>(iter_));
+ return (break_type_ == BREAK_WORD && status != UBRK_WORD_NONE);
}
string16 BreakIterator::GetString() const {
« no previous file with comments | « base/i18n/break_iterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698