]> Cypherpunks.ru repositories - gostls13.git/commit
time: allow minimum int64 in ParseDuration
authorMeng Zhuo <mzh@golangcn.org>
Sun, 26 Sep 2021 06:56:55 +0000 (14:56 +0800)
committerMeng Zhuo <mzh@golangcn.org>
Fri, 8 Oct 2021 14:08:12 +0000 (14:08 +0000)
commit5b9206f64ef4d8ea3201627cf9ba5c2b86e65022
treea9522cf54d0db6a6eb50252c4cf33285bfa2d3ae
parente74db46519a7cbed16a7f14932da2ef93d647ece
time: allow minimum int64 in ParseDuration

ParseDuration should handle minimum int64 (-1<<63) nanosecond
since type Duration is alias of int64

name           old time/op  new time/op  delta
ParseDuration  91.4ns ± 0%  86.4ns ± 1%  -5.49%  (p=0.000 n=9+8)

Fixes: #48629
Change-Id: I81b7035b25cefb4c1e5b7801c20f2d335e29358a
Reviewed-on: https://go-review.googlesource.com/c/go/+/352269
Trust: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/time/format.go
src/time/time_test.go