Explorar o código

remove duplicate logic

Fabrizio (Misto) Milo %!s(int64=13) %!d(string=hai) anos
pai
achega
384d79d671
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  1. 2 6
      store/watcher.go

+ 2 - 6
store/watcher.go

@@ -52,15 +52,11 @@ func (w *WatcherHub) addWatcher(prefix string, watcher *Watcher, sinceIndex uint
 	_, ok := w.watchers[prefix]
 	_, ok := w.watchers[prefix]
 
 
 	if !ok {
 	if !ok {
-
 		w.watchers[prefix] = make([]*Watcher, 0)
 		w.watchers[prefix] = make([]*Watcher, 0)
-
-		w.watchers[prefix] = append(w.watchers[prefix], watcher)
-	} else {
-
-		w.watchers[prefix] = append(w.watchers[prefix], watcher)
 	}
 	}
 
 
+	w.watchers[prefix] = append(w.watchers[prefix], watcher)
+
 	return nil
 	return nil
 }
 }