From 8e348d6f184db9cd802cb81bf7b4a9dbb338fb74 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 27 Aug 2019 14:32:18 +0900 Subject: table: delete unused deleteDestByNlri() Signed-off-by: FUJITA Tomonori --- internal/pkg/table/table.go | 8 -------- internal/pkg/table/table_test.go | 13 ------------- 2 files changed, 21 deletions(-) (limited to 'internal/pkg') diff --git a/internal/pkg/table/table.go b/internal/pkg/table/table.go index a2002b41..c7e505cc 100644 --- a/internal/pkg/table/table.go +++ b/internal/pkg/table/table.go @@ -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())) diff --git a/internal/pkg/table/table_test.go b/internal/pkg/table/table_test.go index 1e91aa6b..e0f1f3cf 100644 --- a/internal/pkg/table/table_test.go +++ b/internal/pkg/table/table_test.go @@ -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) -- cgit v1.2.3