Skip to content
Snippets Groups Projects
Commit 784d6633 authored by Wolfgang Welz's avatar Wolfgang Welz
Browse files

Avoid variable shadowing

parent 50381055
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,9 @@ func (this *PeerRegister) Remove(key string, lock ...bool) { ...@@ -73,7 +73,9 @@ func (this *PeerRegister) Remove(key string, lock ...bool) {
if len(lock) == 0 || lock[0] { if len(lock) == 0 || lock[0] {
defer this.Lock()() defer this.Lock()()
if peerEntry, exists := this.Peers[key]; exists { // needs to be updated after locking
peerEntry, exists = this.Peers[key]
if exists {
delete(this.Peers, key) delete(this.Peers, key)
this.Events.Remove.Trigger(peerEntry) this.Events.Remove.Trigger(peerEntry)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment