Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jul 26, 2023
1 parent 852bf04 commit 024a7e9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,15 @@ private async ValueTask StepDown()
if (await auditTrail.ContainsAsync(prevLogIndex, prevLogTerm, token).ConfigureAwait(false))
{
bool emptySet;
ReplicationWithSenderTermDetector<TEntry>? proxy;

if (emptySet = entries.RemainingCount is 0L)
if (entries.RemainingCount is 0L)
{
proxy = null;
emptySet = true;
}
else
{
entries = proxy = new(entries, senderTerm);
entries = new ReplicationWithSenderTermDetector<TEntry>(entries, senderTerm);
emptySet = false;
}

// prevent Follower state transition during processing of received log entries
Expand All @@ -644,7 +644,7 @@ private async ValueTask StepDown()
* If it is 'false' then the method will throw the exception and the node becomes unavailable in each replication cycle.
*/
await auditTrail.AppendAndCommitAsync(entries, prevLogIndex + 1L, true, commitIndex, token).ConfigureAwait(false);
result = result with { Value = proxy is { IsReplicatedWithExpectedTerm: true } };
result = result with { Value = entries is ReplicationWithSenderTermDetector<TEntry> { IsReplicatedWithExpectedTerm: true } };

// process configuration
var fingerprint = (ConfigurationStorage.ProposedConfiguration ?? ConfigurationStorage.ActiveConfiguration).Fingerprint;
Expand Down

0 comments on commit 024a7e9

Please sign in to comment.