mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
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:
@@ -415,7 +415,7 @@ func (p *lowerInterfacesPass) run() {
|
|||||||
for _, t := range p.types {
|
for _, t := range p.types {
|
||||||
typeSlice = append(typeSlice, t)
|
typeSlice = append(typeSlice, t)
|
||||||
}
|
}
|
||||||
sort.Sort(typeSlice)
|
sort.Sort(sort.Reverse(typeSlice))
|
||||||
|
|
||||||
// A type code must fit in 16 bits.
|
// A type code must fit in 16 bits.
|
||||||
if len(typeSlice) >= 1<<16 {
|
if len(typeSlice) >= 1<<16 {
|
||||||
|
|||||||
Reference in New Issue
Block a user