Skip to content

Commit

Permalink
Remove unnecessary intermediate allocations
Browse files Browse the repository at this point in the history
Summary: TSIA

Reviewed By: michalmuskala

Differential Revision: D69056710

fbshipit-source-id: 05e93bdcbd8dda8fdb99e1c52a2aeab039eef8d4
  • Loading branch information
TD5 authored and facebook-github-bot committed Feb 4, 2025
1 parent 9652466 commit 5cd7141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wa_raft_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ candidate(cast, ?REMOTE(?IDENTITY_REQUIRES_MIGRATION(_, NodeId), ?VOTE(true)),
Duration = erlang:monotonic_time(millisecond) - StateStartTs,
LastIndex = wa_raft_log:last_index(View),
{ok, LastTerm} = wa_raft_log:term(View, LastIndex),
EstablishedQuorum = [Peer || {Peer, true} <- maps:to_list(Votes1)],
EstablishedQuorum = [Peer || Peer := true <- Votes1],
?LOG_NOTICE("Server[~0p, term ~0p, candidate] is becoming leader after ~0p ms with log at ~0p:~0p and votes from ~0p.",
[Name, CurrentTerm, Duration, LastIndex, LastTerm, EstablishedQuorum], #{domain => [whatsapp, wa_raft]}),
?RAFT_GATHER('raft.candidate.election.duration', Duration),
Expand Down

0 comments on commit 5cd7141

Please sign in to comment.