Skip to content

Commit

Permalink
cleanup(router): remove unused field (#37)
Browse files Browse the repository at this point in the history
This diff removes the unused `devs` field.
  • Loading branch information
bassosimone authored Nov 27, 2024
1 parent ee46f4a commit b37fe75
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions netsim/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import (

// Router provides routing capabilities.
type Router struct {
// devs tracks attached [packet.NetworkDevice].
devs []packet.NetworkDevice

// filtermu protects access to filters.
filtermu sync.RWMutex

Expand All @@ -29,7 +26,6 @@ type Router struct {
// New creates a new [*Router].
func New() *Router {
return &Router{
devs: make([]packet.NetworkDevice, 0),
filtermu: sync.RWMutex{},
filters: make([]packet.Filter, 0),
srt: make(map[netip.Addr]packet.NetworkDevice),
Expand All @@ -45,7 +41,6 @@ func (r *Router) AddFilter(pf packet.Filter) {

// Attach attaches a [packet.NetworkDevice] to the [*Router].
func (r *Router) Attach(dev packet.NetworkDevice) {
r.devs = append(r.devs, dev)
go r.readLoop(dev)
}

Expand Down

0 comments on commit b37fe75

Please sign in to comment.