From 08cc3dc5e70986dde114cb5b22d94848ed1b5419 Mon Sep 17 00:00:00 2001 From: Ilya Tocar Date: Tue, 21 Aug 2018 14:40:01 -0500 Subject: [PATCH] time: optimize big4 Use the same load order in big4 as in encoding/binary.BigEndian. This order is recognized by the compiler and converted into single load. This isn't in the hot path, but doesn't hurt readability, so lets do this. Change-Id: Ib1240d0b278e9d667ad419fe91fa52b23d28cfc0 Reviewed-on: https://go-review.googlesource.com/130478 Run-TryBot: Ilya Tocar TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/time/zoneinfo_read.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/time/zoneinfo_read.go b/src/time/zoneinfo_read.go index 20f84f0067..29244db29e 100644 --- a/src/time/zoneinfo_read.go +++ b/src/time/zoneinfo_read.go @@ -55,7 +55,7 @@ func (d *dataIO) big4() (n uint32, ok bool) { d.error = true return 0, false } - return uint32(p[0])<<24 | uint32(p[1])<<16 | uint32(p[2])<<8 | uint32(p[3]), true + return uint32(p[3]) | uint32(p[2])<<8 | uint32(p[1])<<16 | uint32(p[0])<<24, true } func (d *dataIO) byte() (n byte, ok bool) { -- 2.48.1