Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix
Browse files Browse the repository at this point in the history
younies committed Jan 20, 2025
1 parent 2e942fd commit 05351c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions icu4c/source/i18n/measunit_extra.cpp
Original file line number Diff line number Diff line change
@@ -468,7 +468,6 @@ void U_CALLCONV initUnitExtras(UErrorCode& status) {
class Token {
public:
Token(int64_t match) : fMatch(match) {
U_ASSERT(fMatch > 0);
if (fMatch < kCompoundPartOffset) {
this->fType = TYPE_PREFIX;
} else if (fMatch < kInitialCompoundPartOffset) {
@@ -477,8 +476,9 @@ class Token {
this->fType = TYPE_INITIAL_COMPOUND_PART;
} else if (fMatch < kSimpleUnitOffset) {
this->fType = TYPE_POWER_PART;
} else {
this->fType = TYPE_SIMPLE_UNIT;
}
this->fType = TYPE_SIMPLE_UNIT;
}

static Token constantToken(StringPiece str, UErrorCode &status) {
@@ -507,7 +507,7 @@ class Token {
// Calling getType() is invalid, resulting in an assertion failure, if Token
// value isn't positive.
Type getType() const {
U_ASSERT(fMatch > 0);
U_ASSERT(fMatch >= 0);
return this->fType;
}

0 comments on commit 05351c8

Please sign in to comment.