mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-27 17:21:23 +00:00
fix codex warning
Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
parent
48f451fdba
commit
b4adbf7810
@ -354,7 +354,7 @@ void ZoneUtil::GetCountryZones(std::string ®ion, 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);
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user