k1 := symkind(s1)
k2 := symkind(s2)
if k1 != k2 {
- return k1-k2 < 0
+ return k1 < k2
}
- return stringsCompare(s1.Extname, s2.Extname) < 0
+ return s1.Extname < s2.Extname
}
func machogenasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
Cseek(endoff)
}
-type pescmp []*LSym
+type byExtname []*LSym
-func (x pescmp) Len() int {
- return len(x)
-}
-
-func (x pescmp) Swap(i, j int) {
- x[i], x[j] = x[j], x[i]
-}
-
-func (x pescmp) Less(i, j int) bool {
- s1 := x[i]
- s2 := x[j]
- return stringsCompare(s1.Extname, s2.Extname) < 0
-}
+func (s byExtname) Len() int { return len(s) }
+func (s byExtname) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+func (s byExtname) Less(i, j int) bool { return s[i].Extname < s[j].Extname }
func initdynexport() {
nexport = 0
nexport++
}
- sort.Sort(pescmp(dexport[:nexport]))
+ sort.Sort(byExtname(dexport[:nexport]))
}
func addexports() {