Skip to content

Commit 20759b9

Browse files
committed
fix: remove function AddIfNotExists from connection pool due to no usage #212
1 parent 61b02d1 commit 20759b9

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

sip/transport_connection_pool.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,6 @@ func (p *ConnectionPool) Add(a string, c Connection) {
5959
p.Unlock()
6060
}
6161

62-
func (p *ConnectionPool) AddIfNotExists(a string, c Connection) {
63-
// TODO how about multi connection support for same remote address
64-
// We can then check ref count
65-
66-
p.Lock()
67-
_, exists := p.m[a]
68-
if !exists {
69-
p.Unlock()
70-
return
71-
}
72-
p.m[a] = c
73-
p.Unlock()
74-
75-
if c.Ref(0) < 1 {
76-
c.Ref(1) // Make 1 reference count by default
77-
}
78-
}
79-
8062
// Getting connection pool increases reference
8163
// Make sure you TryClose after finish
8264
func (p *ConnectionPool) Get(a string) (c Connection) {

0 commit comments

Comments
 (0)