Reorder setChannel method

This commit is contained in:
Asim Aslam 2019-10-25 14:24:37 +01:00
parent c170189efb
commit 1c9ada6413

View File

@ -124,6 +124,12 @@ func (l *link) delChannel(ch string) {
l.Unlock()
}
func (l *link) getChannel(ch string) time.Time {
l.RLock()
defer l.RUnlock()
return l.channels[ch]
}
func (l *link) setChannel(channels ...string) {
l.Lock()
for _, ch := range channels {
@ -132,12 +138,6 @@ func (l *link) setChannel(channels ...string) {
l.Unlock()
}
func (l *link) getChannel(ch string) time.Time {
l.RLock()
defer l.RUnlock()
return l.channels[ch]
}
// set the keepalive time
func (l *link) keepalive() {
l.Lock()