Skip to content

Commit ef8fada

Browse files
committed
Editorial: Switch +1/-1 to avoid negating sign
1 parent 1a837de commit ef8fada

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/zoneddatetime.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,19 +1120,19 @@ <h1>
11201120
1. If _ns1_ = _ns2_, return ! CombineDateAndTimeDuration(ZeroDateDuration(), 0).
11211121
1. Let _startDateTime_ be GetISODateTimeFor(_timeZone_, _ns1_).
11221122
1. Let _endDateTime_ be GetISODateTimeFor(_timeZone_, _ns2_).
1123-
1. If _ns2_ - _ns1_ &lt; 0, let _sign_ be -1; else let _sign_ be 1.
1124-
1. If _sign_ = 1, let _maxDayCorrection_ be 2; else let _maxDayCorrection_ be 1.
1123+
1. If _ns2_ - _ns1_ &lt; 0, let _sign_ be 1; else let _sign_ be -1.
1124+
1. If _sign_ = -1, let _maxDayCorrection_ be 2; else let _maxDayCorrection_ be 1.
11251125
1. Let _dayCorrection_ be 0.
11261126
1. Let _timeDuration_ be DifferenceTime(_startDateTime_.[[Time]], _endDateTime_.[[Time]]).
1127-
1. If TimeDurationSign(_timeDuration_) = -_sign_, set _dayCorrection_ to _dayCorrection_ + 1.
1127+
1. If TimeDurationSign(_timeDuration_) = _sign_, set _dayCorrection_ to _dayCorrection_ + 1.
11281128
1. Let _success_ be *false*.
11291129
1. Repeat, while _dayCorrection__maxDayCorrection_ and _success_ is *false*,
1130-
1. Let _intermediateDate_ be AddDaysToISODate(_endDateTime_.[[ISODate]], _dayCorrection_ × -_sign_).
1130+
1. Let _intermediateDate_ be AddDaysToISODate(_endDateTime_.[[ISODate]], _dayCorrection_ × _sign_).
11311131
1. Let _intermediateDateTime_ be CombineISODateAndTimeRecord(_intermediateDate_, _startDateTime_.[[Time]]).
11321132
1. Let _intermediateNs_ be ? GetEpochNanosecondsFor(_timeZone_, _intermediateDateTime_, ~compatible~).
11331133
1. Set _timeDuration_ to TimeDurationFromEpochNanosecondsDifference(_ns2_, _intermediateNs_).
11341134
1. Let _timeSign_ be TimeDurationSign(_timeDuration_).
1135-
1. If _sign_-_timeSign_, then
1135+
1. If _sign__timeSign_, then
11361136
1. Set _success_ to *true*.
11371137
1. Set _dayCorrection_ to _dayCorrection_ + 1.
11381138
1. Assert: _success_ is *true*.

0 commit comments

Comments
 (0)