pkg: refactor sort.Sort to slices.SortFunc (#3880)

This commit is contained in:
Oleksandr Redko
2025-01-03 20:44:28 +02:00
committed by GitHub
parent 89e72bed28
commit 75c20c328c
5 changed files with 22 additions and 80 deletions

View File

@ -38,24 +38,6 @@ func pointerTo(typ godwarf.Type, arch *Arch) godwarf.Type {
}
}
type functionsDebugInfoByEntry []Function
func (v functionsDebugInfoByEntry) Len() int { return len(v) }
func (v functionsDebugInfoByEntry) Less(i, j int) bool { return v[i].Entry < v[j].Entry }
func (v functionsDebugInfoByEntry) Swap(i, j int) { v[i], v[j] = v[j], v[i] }
type compileUnitsByOffset []*compileUnit
func (v compileUnitsByOffset) Len() int { return len(v) }
func (v compileUnitsByOffset) Less(i int, j int) bool { return v[i].offset < v[j].offset }
func (v compileUnitsByOffset) Swap(i int, j int) { v[i], v[j] = v[j], v[i] }
type packageVarsByAddr []packageVar
func (v packageVarsByAddr) Len() int { return len(v) }
func (v packageVarsByAddr) Less(i int, j int) bool { return v[i].addr < v[j].addr }
func (v packageVarsByAddr) Swap(i int, j int) { v[i], v[j] = v[j], v[i] }
type loadDebugInfoMapsContext struct {
ardr *reader.Reader
abstractOriginTable map[dwarf.Offset]int