ipn: use *Prefs rather than Prefs throughout.
Prefs has become a heavy object with non-memcpy copy semantics. We should not pass such a thing by value. Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
committed by
Dave Anderson
parent
0c55777fed
commit
c47f907a27
+6
-2
@@ -53,8 +53,12 @@ func (b *FakeBackend) Logout() {
|
||||
b.newState(NeedsLogin)
|
||||
}
|
||||
|
||||
func (b *FakeBackend) SetPrefs(new Prefs) {
|
||||
b.notify(Notify{Prefs: &new})
|
||||
func (b *FakeBackend) SetPrefs(new *Prefs) {
|
||||
if new == nil {
|
||||
panic("FakeBackend.SetPrefs got nil prefs")
|
||||
}
|
||||
|
||||
b.notify(Notify{Prefs: new.Copy()})
|
||||
if new.WantRunning && !b.live {
|
||||
b.newState(Starting)
|
||||
b.newState(Running)
|
||||
|
||||
Reference in New Issue
Block a user