Browse Source

remove duplicate logic

Fabrizio (Misto) Milo 12 years ago
parent
commit
384d79d671
1 changed files with 2 additions and 6 deletions
  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
 }
 }