mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-12-02 12:31:08 +00:00
改代码规范问题7
Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
parent
1c3e9c7522
commit
aa95a84dd5
@ -738,9 +738,6 @@ std::string I18nTimeZone::GetDisplayNameByTaboo(const std::string& localeStr, st
|
||||
getReplacedTimezoneDisplayName(localeStr.c_str(), GetID().c_str(), recvArr);
|
||||
}
|
||||
result = recvArr;
|
||||
#ifndef SUPPORT_ASAN
|
||||
dlclose(i18nUtilHandle);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@ std::set<std::string> LocaleInfo::GetValidLocales()
|
||||
for (int i = 0; i < validCount; i++) {
|
||||
allValidLocales.insert(validLocales[i].getLanguage());
|
||||
}
|
||||
delete[] validLocales;
|
||||
}
|
||||
allValidLocales.insert("in");
|
||||
allValidLocales.insert("iw");
|
||||
|
@ -45,7 +45,6 @@ PhoneNumberMatched::PhoneNumberMatched(std::string& country)
|
||||
PhoneNumberMatched::~PhoneNumberMatched()
|
||||
{
|
||||
delete phoneNumberRule;
|
||||
delete phoneNumberUtil;
|
||||
delete shortNumberInfo;
|
||||
}
|
||||
|
||||
@ -168,7 +167,6 @@ std::vector<MatchedNumberInfo> PhoneNumberMatched::FindShortNumbers(std::string&
|
||||
matchedNumberInfoList.push_back(matcher);
|
||||
}
|
||||
}
|
||||
delete shortMatch;
|
||||
return matchedNumberInfoList;
|
||||
}
|
||||
|
||||
@ -264,7 +262,6 @@ bool PhoneNumberMatched::HandleWithShortAndShort(std::vector<MatchedNumberInfo>&
|
||||
ReplaceSpecifiedPos(filteredString, pos.first, pos.second);
|
||||
flag = true;
|
||||
}
|
||||
delete matcher;
|
||||
} else {
|
||||
result.push_back(info);
|
||||
ReplaceSpecifiedPos(filteredString, pos.first, pos.second);
|
||||
@ -454,12 +451,12 @@ std::vector<MatchedNumberInfo> PhoneNumberMatched::HandlePositiveRule(PhoneNumbe
|
||||
icu::RegexPattern* pattern = rule->GetPattern();
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
icu::RegexMatcher* mat1 = pattern->matcher(str, status);
|
||||
if (mat1->find(status)) {
|
||||
if (mat1 != nullptr && mat1->find(status)) {
|
||||
std::vector<MatchedNumberInfo> infoList = rule->Handle(match, message);
|
||||
return infoList;
|
||||
}
|
||||
icu::RegexMatcher* mat2 = pattern->matcher(message, status);
|
||||
if (mat2->find(status)) {
|
||||
if (mat2 != nullptr &&mat2->find(status)) {
|
||||
std::vector<MatchedNumberInfo> infoList = rule->Handle(match, message);
|
||||
if (infoList.size() == 0) {
|
||||
continue;
|
||||
|
@ -516,7 +516,6 @@ std::vector<MatchedNumberInfo> RegexRule::HandlePossibleNumberWithPattern(icu::R
|
||||
matchedList.push_back(info);
|
||||
}
|
||||
}
|
||||
delete mat;
|
||||
return matchedList;
|
||||
}
|
||||
} // namespace I18n
|
||||
|
Loading…
Reference in New Issue
Block a user