From bee117611d7fc56aabc36d6341e4a0d5d4fa1461 Mon Sep 17 00:00:00 2001 From: Marco Vidonis <31407403+marcovidonis@users.noreply.github.com> Date: Thu, 4 Apr 2024 02:29:22 +0100 Subject: [PATCH] remove code repetition (#926) --- client.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/client.go b/client.go index 43a8fc46b4..a0af80c9e5 100644 --- a/client.go +++ b/client.go @@ -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, @@ -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()