From 9262f724d14f53ec43440ae68204cfc4f67b3eb4 Mon Sep 17 00:00:00 2001 From: Cem Sancak Date: Fri, 3 Jul 2020 16:35:20 +0300 Subject: [PATCH] remove unnecessary var --- niftycache.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/niftycache.go b/niftycache.go index 5afe886..fe7843b 100644 --- a/niftycache.go +++ b/niftycache.go @@ -117,17 +117,15 @@ func (nc *Cache) Close() { func (nc *Cache) handleCallbacks() { done := nc.done - leave := false for { select { case <-done: done = nil - leave = true default: nc.m.Lock() if nc.callbacks.Length() == 0 { nc.m.Unlock() - if leave { + if done == nil { nc.wg.Done() return }