fix codex warning

Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
sunyaozu 2023-04-04 09:44:27 +08:00
parent 48f451fdba
commit b4adbf7810
2 changed files with 6 additions and 5 deletions

View File

@ -354,7 +354,7 @@ void ZoneUtil::GetCountryZones(std::string &region, std::string &defaultTimzone,
}
if (findCountry) {
value = value->next;
GetDefaultAndBoost(value, defaultTimzone, isBoosted, zones);
GetDefaultAndBoost(value, defaultTimzone, isBoosted, zones);
}
xmlFreeDoc(doc);
return;
@ -471,7 +471,8 @@ CountryResult ZoneUtil::Match(std::vector<std::string> &zones, NITZData &nitzDat
}
bool ZoneUtil::CheckSameDstOffset(std::vector<std::string> &zones, std::string &defaultTimezoneId,
int64_t currentMillis) {
int64_t currentMillis)
{
UnicodeString defaultID(defaultTimezoneId.data(), defaultTimezoneId.length());
TimeZone *defaultTimezone = TimeZone::createTimeZone(defaultID);
int32_t rawOffset = 0;
@ -484,7 +485,7 @@ bool ZoneUtil::CheckSameDstOffset(std::vector<std::string> &zones, std::string &
return false;
}
int32_t totalOffset = rawOffset + dstOffset;
for (int32_t i = 0; i < zones.size(); i++) {
for (size_t i = 0; i < zones.size(); i++) {
UnicodeString unicodeZoneID(zones[i].data(), zones[i].length());
TimeZone *timezone = TimeZone::createTimeZone(unicodeZoneID);
timezone->getOffset(currentMillis, (UBool)local, rawOffset, dstOffset, status);

View File

@ -196,7 +196,7 @@ HWTEST_F(ZoneUtilTest, ZoneUtilFuncTest009, TestSize.Level1)
{
ZoneUtil util;
std::string region = "CN";
NITZData nitzData = { 0, 28800000 , 1679969021999 };
NITZData nitzData = { 0, 28800000, 1679969021999 };
CountryResult result = util.LookupTimezoneByCountryAndNITZ(region, nitzData);
EXPECT_TRUE(result.isOnlyMatch);
EXPECT_EQ(result.timezoneId, "Asia/Shanghai");
@ -215,7 +215,7 @@ HWTEST_F(ZoneUtilTest, ZoneUtilFuncTest009, TestSize.Level1)
HWTEST_F(ZoneUtilTest, ZoneUtilFuncTest010, TestSize.Level1)
{
ZoneUtil util;
NITZData nitzData = { 0, 28800000 , 1679969021999 };
NITZData nitzData = { 0, 28800000, 1679969021999 };
CountryResult result = util.LookupTimezoneByNITZ(nitzData);
EXPECT_FALSE(result.isOnlyMatch);
EXPECT_EQ(result.timezoneId, "Asia/Shanghai");