From 1d34f868da5e751a62f0574e65dc28d1979091f8 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 12 Dec 2018 14:22:52 +0100 Subject: [PATCH] compiler: sort interface type codes in reverse order This makes sure the most commonly used types have the lowest type codes. This was intended to be the case, but apparently I forgot to sort them the right way. --- compiler/interface-lowering.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/interface-lowering.go b/compiler/interface-lowering.go index a9812980..00f0df20 100644 --- a/compiler/interface-lowering.go +++ b/compiler/interface-lowering.go @@ -415,7 +415,7 @@ func (p *lowerInterfacesPass) run() { for _, t := range p.types { typeSlice = append(typeSlice, t) } - sort.Sort(typeSlice) + sort.Sort(sort.Reverse(typeSlice)) // A type code must fit in 16 bits. if len(typeSlice) >= 1<<16 {