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.
This commit is contained in:
Ayke van Laethem
2018-12-12 14:22:52 +01:00
parent f0904779a5
commit 1d34f868da
+1 -1
View File
@@ -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 {