ICU-97 Slightly faster performance by saving the symbolLength

X-SVN-Rev: 2736
This commit is contained in:
George Rhoten 2000-10-19 21:31:53 +00:00
parent 94e819c3cb
commit 9862deea3b

View file

@ -637,12 +637,13 @@ inline int32_t
DecimalFormatSymbols::compareInfinity(const UnicodeString& text,
UTextOffset offset) const
{
int32_t symbolLength = fSymbols[kInfinitySymbol].length();
return text.compare(offset,
fSymbols[kInfinitySymbol].length(),
symbolLength,
fSymbols[kInfinitySymbol],
0,
fSymbols[kInfinitySymbol].length())
? 0 : fSymbols[kInfinitySymbol].length();
symbolLength)
? 0 : symbolLength;
}
// -------------------------------------
@ -666,12 +667,13 @@ DecimalFormatSymbols::setNaN(const UnicodeString& NaN)
inline int32_t
DecimalFormatSymbols::compareNaN(const UnicodeString& text, UTextOffset offset) const
{
int32_t symbolLength = fSymbols[kNaNSymbol].length();
return text.compare(offset,
fSymbols[kNaNSymbol].length(),
symbolLength,
fSymbols[kNaNSymbol],
0,
fSymbols[kNaNSymbol].length())
? 0 : fSymbols[kNaNSymbol].length();
symbolLength)
? 0 : symbolLength;
}
// -------------------------------------
@ -744,12 +746,13 @@ inline int32_t
DecimalFormatSymbols::compareCurrencySymbol(const UnicodeString& text,
UTextOffset offset) const
{
int32_t symbolLength = fSymbols[kCurrencySymbol].length();
return text.compare(offset,
fSymbols[kCurrencySymbol].length(),
symbolLength,
fSymbols[kCurrencySymbol],
0,
fSymbols[kCurrencySymbol].length())
? 0 : fSymbols[kCurrencySymbol].length();
symbolLength)
? 0 : symbolLength;
}
// -------------------------------------
@ -774,12 +777,13 @@ inline int32_t
DecimalFormatSymbols::compareInternationalCurrencySymbol(const UnicodeString& text,
UTextOffset offset) const
{
int32_t symbolLength = fSymbols[kIntlCurrencySymbol].length();
return text.compare(offset,
fSymbols[kIntlCurrencySymbol].length(),
symbolLength,
fSymbols[kIntlCurrencySymbol],
0,
fSymbols[kIntlCurrencySymbol].length())
? 0 : fSymbols[kIntlCurrencySymbol].length();
symbolLength)
? 0 : symbolLength;
}
// -------------------------------------