mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-23 15:10:32 +00:00
cppcheck整改
Signed-off-by: yeheng <duanyeheng@huawei.com>
This commit is contained in:
parent
875842bc1a
commit
b25c662e3f
@ -137,7 +137,7 @@ int32_t LocaleCompare::Compare(const std::string& localeTag1, const std::string&
|
||||
icu::Locale locale1 = icu::Locale::forLanguageTag(icu::StringPiece(localeTag1), status);
|
||||
icu::Locale locale2 = icu::Locale::forLanguageTag(icu::StringPiece(localeTag2), status);
|
||||
int32_t segmentScore = 3;
|
||||
int32_t mapScore = 0;
|
||||
const int32_t mapScore = 0;
|
||||
int32_t score = 0;
|
||||
std::string language1 = locale1.getLanguage();
|
||||
std::string language2 = locale2.getLanguage();
|
||||
|
@ -141,11 +141,8 @@ void SystemLocaleManager::SortLocaleItemList(std::vector<LocaleItem> &localeItem
|
||||
}
|
||||
return false;
|
||||
};
|
||||
if (options.isSuggestedFirst) {
|
||||
std::sort(localeItemList.begin(), localeItemList.end(), compareFunc);
|
||||
} else {
|
||||
std::sort(localeItemList.begin(), localeItemList.end(), compareFunc);
|
||||
}
|
||||
|
||||
std::sort(localeItemList.begin(), localeItemList.end(), compareFunc);
|
||||
delete collator;
|
||||
}
|
||||
} // I18n
|
||||
|
@ -233,13 +233,13 @@ bool ZoneUtil::Init()
|
||||
CountryResult ZoneUtil::LookupTimezoneByCountryAndNITZ(std::string ®ion, NITZData &nitzData)
|
||||
{
|
||||
std::vector<std::string> zones;
|
||||
bool isBoosted = false;
|
||||
std::string defaultTimezone;
|
||||
std::string systemTimezone = ReadSystemParameter(TIMEZONE_KEY, SYS_PARAM_LEN);
|
||||
if (systemTimezone.length() == 0) {
|
||||
systemTimezone = DEFAULT_TIMEZONE;
|
||||
}
|
||||
if (CheckFileExist()) {
|
||||
bool isBoosted = false;
|
||||
HiLog::Info(LABEL, "ZoneUtil::LookupTimezoneByCountryAndNITZ use tzlookup.xml");
|
||||
GetCountryZones(region, defaultTimezone, isBoosted, zones);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user