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
|
return pls, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func differentPlayers(a, b []*player) bool {
|
func samePlayers(a, b []*player) bool {
|
||||||
if len(a) == len(b) {
|
if len(a) != len(b) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
for i, p := range a {
|
for i, p := range a {
|
||||||
if !p.same(b[i]) {
|
if !p.same(b[i]) {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ps *players) run() {
|
func (ps *players) run() {
|
||||||
@ -115,7 +115,7 @@ func (ps *players) run() {
|
|||||||
sort.Sort(sortPlayersByName(pls))
|
sort.Sort(sortPlayersByName(pls))
|
||||||
var change bool
|
var change bool
|
||||||
ps.mu.Lock()
|
ps.mu.Lock()
|
||||||
if change = differentPlayers(pls, ps.pls); change {
|
if change = !samePlayers(pls, ps.pls); change {
|
||||||
ps.pls = pls
|
ps.pls = pls
|
||||||
}
|
}
|
||||||
ps.mu.Unlock()
|
ps.mu.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user