Skip to content

Commit

Permalink
remove code repetition (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovidonis authored Apr 4, 2024
1 parent 967dc8b commit bee1176
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,6 @@ func NewClient(cfg *ClientConfig) (cl *Client, err error) {
}
}

var ICEServers []webrtc.ICEServer
if cl.config.ICEServerList != nil {
ICEServers = cl.config.ICEServerList
} else if cl.config.ICEServers != nil {
ICEServers = []webrtc.ICEServer{{URLs: cl.config.ICEServers}}
}

cl.websocketTrackers = websocketTrackers{
PeerId: cl.peerID,
Logger: cl.logger,
Expand All @@ -336,7 +329,7 @@ func NewClient(cfg *ClientConfig) (cl *Client, err error) {
},
Proxy: cl.config.HTTPProxy,
WebsocketTrackerHttpHeader: cl.config.WebsocketTrackerHttpHeader,
ICEServers: ICEServers,
ICEServers: cl.ICEServers(),
DialContext: cl.config.TrackerDialContext,
OnConn: func(dc datachannel.ReadWriteCloser, dcc webtorrent.DataChannelContext) {
cl.lock()
Expand Down

0 comments on commit bee1176

Please sign in to comment.