mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 09:20:17 +01:00
Fixed stupid logic mistake.
This commit is contained in:
parent
09e24cda65
commit
d242fb5cf1
@ -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 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()
|
||||
|
Loading…
Reference in New Issue
Block a user