Skip to content

Commit 2671b84

Browse files
committed
timeout precision
on try, don't do anything if dur <= 0
1 parent 54b0db1 commit 2671b84

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/xo/s.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ func (s *S) String() string {
190190
}
191191

192192
func (s *S) Try(dur time.Duration) int {
193+
if dur <= 0 {
194+
return 0
195+
}
193196
s.startTime = time.Now()
194197
s.deadline = s.startTime.Add(dur)
195198
return s.Solve()

0 commit comments

Comments
 (0)