Fixed stupid logic mistake.

This commit is contained in:
Sascha L. Teichmann 2015-03-10 12:17:28 +01:00
parent 09e24cda65
commit d242fb5cf1
1 changed files with 5 additions and 5 deletions

View File

@ -90,16 +90,16 @@ func (ps *players) readFromFIFO() ([]*player, error) {
return pls, nil
}
func differentPlayers(a, b []*player) bool {
if len(a) == len(b) {
func samePlayers(a, b []*player) bool {
if len(a) != len(b) {
return true
}
for i, p := range a {
if !p.same(b[i]) {
return true
return false
}
}
return false
return true
}
func (ps *players) run() {
@ -115,7 +115,7 @@ func (ps *players) run() {
sort.Sort(sortPlayersByName(pls))
var change bool
ps.mu.Lock()
if change = differentPlayers(pls, ps.pls); change {
if change = !samePlayers(pls, ps.pls); change {
ps.pls = pls
}
ps.mu.Unlock()