Simplify switchActiveReplicas function
No semantic change, since either it was active before and is now still
active or it was inactive and now is active.
Longhorn
@@ -2330,10 +2330,7 @@ func (vc *VolumeController) switchActiveReplicas(rs map[string]*longhorn.Replica
// delete the volume data on the disk.
// Set `active` at last to prevent data loss
for _, r := range rs {
- if activeCondFunc(r, obj) != r.Spec.Active {
r.Spec.Active = activeCondFunc(r, obj)
- rs[r.Name] = r
- }
}
return nil
}
