Skip to content

Commit

Permalink
table: delete unused deleteDestByNlri()
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
  • Loading branch information
fujita committed Aug 27, 2019
1 parent e25e937 commit 8e348d6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
8 changes: 0 additions & 8 deletions internal/pkg/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ func (t *Table) deleteRTCPathsByVrf(vrf *Vrf, vrfs map[string]*Vrf) []*Path {
return pathList
}

func (t *Table) deleteDestByNlri(nlri bgp.AddrPrefixInterface) *Destination {
if dst := t.GetDestination(nlri); dst != nil {
t.deleteDest(dst)
return dst
}
return nil
}

func (t *Table) deleteDest(dest *Destination) {
destinations := t.GetDestinations()
delete(destinations, t.tableKey(dest.GetNlri()))
Expand Down
13 changes: 0 additions & 13 deletions internal/pkg/table/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ import (
"github.com/stretchr/testify/assert"
)

func TestTableDeleteDestByNlri(t *testing.T) {
peerT := TableCreatePeer()
pathT := TableCreatePath(peerT)
ipv4t := NewTable(bgp.RF_IPv4_UC)
for _, path := range pathT {
dest := NewDestination(path.GetNlri(), 0)
ipv4t.setDestination(dest)
}
gdest := ipv4t.GetDestination(pathT[0].GetNlri())
rdest := ipv4t.deleteDestByNlri(pathT[0].GetNlri())
assert.Equal(t, rdest, gdest)
}

func TestTableDeleteDest(t *testing.T) {
peerT := TableCreatePeer()
pathT := TableCreatePath(peerT)
Expand Down

0 comments on commit 8e348d6

Please sign in to comment.