diff --git a/core/plugin/change_account/change_account.rb b/core/plugin/change_account/change_account.rb index 541b189..4e0d180 100644 --- a/core/plugin/change_account/change_account.rb +++ b/core/plugin/change_account/change_account.rb @@ -20,8 +20,7 @@ Plugin.create :change_account do index = Service.instances.index(Service.primary) if index max = Service.instances.size - bound = max - 1 - Service.set_primary(Service.instances[(bound - (bound - index - 1)) % max]) + Service.set_primary(Service.instances[(max + index - 1) % max]) elsif not Service.instances.empty? Service.set_primary(Service.instances.first) end end