!429 cppcheck整改

Merge pull request !429 from yeheng/master
This commit is contained in:
openharmony_ci 2023-05-27 08:08:53 +00:00 committed by Gitee
commit 2d5fc22b08
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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 {