cppcheck整改

Signed-off-by: yeheng <duanyeheng@huawei.com>
This commit is contained in:
yeheng 2023-05-26 17:57:14 +08:00
parent 875842bc1a
commit b25c662e3f
3 changed files with 4 additions and 7 deletions

View File

@ -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();

View File

@ -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

View File

@ -233,13 +233,13 @@ bool ZoneUtil::Init()
CountryResult ZoneUtil::LookupTimezoneByCountryAndNITZ(std::string &region, 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 {