diff --git a/pkg/util/timeofday/time_of_day.go b/pkg/util/timeofday/time_of_day.go index 69fd497..6030aad 100644 --- a/pkg/util/timeofday/time_of_day.go +++ b/pkg/util/timeofday/time_of_day.go @@ -34,12 +34,12 @@ const ( // Max is the maximum TimeOfDay value (1 second before midnight) Max = Time2400 - microsecondsPerSecond = 1e6 - microsecondsPerMinute = 60 * microsecondsPerSecond - microsecondsPerHour = 60 * microsecondsPerMinute - microsecondsPerDay = 24 * microsecondsPerHour - nanosPerMicro = 1000 - secondsPerDay = 24 * 60 * 60 + microsecondsPerSecond int64 = 1e6 + microsecondsPerMinute = 60 * microsecondsPerSecond + microsecondsPerHour = 60 * microsecondsPerMinute + microsecondsPerDay = 24 * microsecondsPerHour + nanosPerMicro = 1000 + secondsPerDay = 24 * 60 * 60 ) // New creates a TimeOfDay representing the specified time. @@ -147,19 +147,19 @@ func (t TimeOfDay) Hour() int { if t == Time2400 { return 24 } - return int(int64(t)%microsecondsPerDay) / microsecondsPerHour + return int(int64(t) % microsecondsPerDay / microsecondsPerHour) } // Minute returns the minute offset within the hour specified by t, in the // range [0, 59]. func (t TimeOfDay) Minute() int { - return int(int64(t)%microsecondsPerHour) / microsecondsPerMinute + return int(int64(t) % microsecondsPerHour / microsecondsPerMinute) } // Second returns the second offset within the minute specified by t, in the // range [0, 59]. func (t TimeOfDay) Second() int { - return int(int64(t)%microsecondsPerMinute) / microsecondsPerSecond + return int(int64(t) % microsecondsPerMinute / microsecondsPerSecond) } // Microsecond returns the microsecond offset within the second specified by t, diff --git a/pkg/util/tsearch/eval.go b/pkg/util/tsearch/eval.go index cf65a8c..2148c9f 100644 --- a/pkg/util/tsearch/eval.go +++ b/pkg/util/tsearch/eval.go @@ -173,9 +173,9 @@ func (e *tsEvaluator) evalFollowedBy( if lExhausted && rExhausted { break } - var lPos, rPos int + var lPos, rPos int64 if !lExhausted { - lPos = int(lPositions.positions[lIdx].position) + lOffset + lPos = int64(lPositions.positions[lIdx].position) + int64(lOffset) } else { // Quit unless we're outputting all of the RHS, which we will if we have // a negative match on the LHS. @@ -185,7 +185,7 @@ func (e *tsEvaluator) evalFollowedBy( lPos = math.MaxInt64 } if !rExhausted { - rPos = int(rPositions.positions[rIdx].position) + rOffset + rPos = int64(rPositions.positions[rIdx].position) + int64(rOffset) } else { // Quit unless we're outputting all of the LHS, which we will if we have // a negative match on the RHS.