Skip to content

Commit

Permalink
BasicZoneProcessor.h: rename kMinToSec to kSecPerMin, better document…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
bxparks committed Jun 13, 2023
1 parent 18fe3b5 commit e4c64ce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ace_time/BasicZoneProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ class BasicZoneProcessorTemplate: public ZoneProcessor {
const Transition* transition = getTransition(epochSeconds);
if (!transition) return result;

result.dstOffsetSeconds = transition->deltaMinutes * kMinToSec;
result.dstOffsetSeconds = transition->deltaMinutes * kSecPerMin;
result.stdOffsetSeconds = (transition->offsetMinutes
- transition->deltaMinutes) * kMinToSec;
- transition->deltaMinutes) * kSecPerMin;
result.reqStdOffsetSeconds = result.stdOffsetSeconds;
result.reqDstOffsetSeconds = result.dstOffsetSeconds;
result.type = FindResult::kTypeExact;
Expand Down Expand Up @@ -753,11 +753,11 @@ class BasicZoneProcessorTemplate: public ZoneProcessor {
uint8_t mon;
if (rule.isNull()) {
mon = 1; // RULES is either '-' or 'hh:mm' so takes effect in Jan
deltaMinutes = era.deltaSeconds() / kMinToSec;
deltaMinutes = era.deltaSeconds() / kSecPerMin;
transition.abbrev[0] = '\0';
} else {
mon = rule.inMonth();
deltaMinutes = rule.deltaSeconds() / kMinToSec;
deltaMinutes = rule.deltaSeconds() / kSecPerMin;
ace_common::strncpy_T(
transition.abbrev, rule.letter(), internal::kAbbrevSize - 1);
transition.abbrev[internal::kAbbrevSize - 1] = '\0';
Expand All @@ -766,7 +766,7 @@ class BasicZoneProcessorTemplate: public ZoneProcessor {
if (month != 0) {
mon = month;
}
int16_t offsetMinutes = era.offsetSeconds() / kMinToSec + deltaMinutes;
int16_t offsetMinutes = era.offsetSeconds() / kSecPerMin + deltaMinutes;

transition.era = era;
transition.rule = rule;
Expand Down Expand Up @@ -843,7 +843,7 @@ class BasicZoneProcessorTemplate: public ZoneProcessor {
// requires the offset of the previous transition.
const int16_t prevOffsetMinutes = calcRuleOffsetMinutes(
prevTransition->offsetMinutes,
transition.era.offsetSeconds() / kMinToSec,
transition.era.offsetSeconds() / kSecPerMin,
transition.rule.atTimeSuffix());

// startDateTime
Expand Down Expand Up @@ -912,7 +912,7 @@ class BasicZoneProcessorTemplate: public ZoneProcessor {
}

private:
static const int32_t kMinToSec = 60;
static const int32_t kSecPerMin = 60;

const ZIS* mZoneInfoStore; // nullable
ZIB mZoneInfoBroker;
Expand Down

0 comments on commit e4c64ce

Please sign in to comment.