edges.go 267 B

123456789101112131415161718192021
  1. package iradix
  2. import "sort"
  3. type edges []edge
  4. func (e edges) Len() int {
  5. return len(e)
  6. }
  7. func (e edges) Less(i, j int) bool {
  8. return e[i].label < e[j].label
  9. }
  10. func (e edges) Swap(i, j int) {
  11. e[i], e[j] = e[j], e[i]
  12. }
  13. func (e edges) Sort() {
  14. sort.Sort(e)
  15. }