improved code
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-16 15:05:14 +00:00
parent 6bdb56755d
commit 0dc9215672
3 changed files with 64 additions and 115 deletions

View File

@@ -125,7 +125,7 @@ defmodule PaxosTestAditional do
IO.puts("#{inspect(name)}: started")
[leader | spare] = Enum.sort(participants)
increase_ballot = Enum.take(spare, floor(length(participants) / 2) + 1)
increase_ballot = Enum.take(spare, floor(length(participants) / 2))
if name == leader do
# Propose when passed with :kill_before_decision will die right before a decision is selected
@@ -199,7 +199,7 @@ defmodule PaxosTestAditional do
participants = Enum.sort(participants)
[leader | spare ] = participants
increase_ballot = Enum.take(spare, floor(length(participants) / 2) + 1)
increase_ballot = Enum.take(spare, floor(length(participants) / 2))
[non_leader | _] = Enum.reverse(spare)
if name == non_leader do