Skip to content

Commit 0a21cd1

Browse files
committed
optimize the performance of the function appendFormatRFC3339
1 parent f008ee5 commit 0a21cd1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/time/format_rfc3339.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ func (t Time) appendFormatRFC3339(b []byte, nanos bool) []byte {
5555

5656
if zone > 3600 {
5757
b = appendInt(b, zone/60, 2)
58-
b = append(b, ':')
59-
b = appendInt(b, zone%60, 2)
58+
b = append(b, ':',
59+
tensDigit[zone%60], onesDigit[zone%60])
6060
return b
6161
}
6262

63-
zone %= 3600
6463
b = append(b,
6564
tensDigit[zone/60], onesDigit[zone/60],
6665
':',

0 commit comments

Comments
 (0)