From 51dad96b92fbd483d7674f8f8617cd2bf8ac965b Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 13 Jun 2018 22:47:39 +0900 Subject: api: remove table/ usage in util.go This is a part of work removing table/ usage in api/. api/ will depend on only protobuf stuff and packet/. Signed-off-by: FUJITA Tomonori --- table/table.go | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'table/table.go') diff --git a/table/table.go b/table/table.go index 9d8edf40..82259b0f 100644 --- a/table/table.go +++ b/table/table.go @@ -18,7 +18,6 @@ package table import ( "fmt" "net" - "sort" "strings" "unsafe" @@ -190,27 +189,6 @@ func (t *Table) getOrCreateDest(nlri bgp.AddrPrefixInterface) *Destination { return dest } -func (t *Table) GetSortedDestinations() []*Destination { - results := make([]*Destination, 0, len(t.GetDestinations())) - switch t.routeFamily { - case bgp.RF_IPv4_UC, bgp.RF_IPv6_UC: - r := radix.New() - for _, dst := range t.GetDestinations() { - r.Insert(AddrToRadixkey(dst.nlri), dst) - } - r.Walk(func(s string, v interface{}) bool { - results = append(results, v.(*Destination)) - return false - }) - default: - for _, dst := range t.GetDestinations() { - results = append(results, dst) - } - sort.Sort(destinations(results)) - } - return results -} - func (t *Table) GetDestinations() map[string]*Destination { return t.destinations } -- cgit v1.2.3