aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql
diff options
context:
space:
mode:
authorMartin Möhrmann <martisch@uos.de>2015-01-11 11:29:00 +0100
committerRobert Griesemer <gri@golang.org>2015-04-08 16:17:22 +0000
commitd5ef69814204f1bf8bee75bc89efcbcb33a64606 (patch)
tree265673bfa976af076b59f9a8865dfcfc6891a66d /src/database/sql
parent5c22a4a2e13a7f43d1f3b887e17bd50cf8713afe (diff)
downloadgo-d5ef69814204f1bf8bee75bc89efcbcb33a64606.tar.xz
time: unify formatting of decimals for timestamps
Change function appendUint to appendInt with variable-width 0-padding. This allows the decimal for the year to be generated without extra code to handle the wider padding and directly handles negative numbers. Removes the special casing for numbers with one and two digits. The special case for 0 was unreachable. The new version is slightly slower. benchmark old ns/op new ns/op delta BenchmarkFormat 444 454 +2.25% BenchmarkFormatNow 398 415 +4.27% Change-Id: I4ddef96bf07ad35dca76053321d510441ec6d4f5 Reviewed-on: https://go-review.googlesource.com/2751 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/database/sql')
0 files changed, 0 insertions, 0 deletions