Source file src/cmd/compile/internal/types/sort.go
Documentation: cmd/compile/internal/types
1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package types 6 7 // MethodsByName sorts methods by symbol. 8 type MethodsByName []*Field 9 10 func (x MethodsByName) Len() int { return len(x) } 11 12 func (x MethodsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } 13 14 func (x MethodsByName) Less(i, j int) bool { return x[i].Sym.Less(x[j].Sym) } 15