Skip to content

Commit

Permalink
lists:seq + lists:zip = lists:enumerate (or a better fit from wa_lists)
Browse files Browse the repository at this point in the history
Summary: as title

Reviewed By: RunyaoZhang

Differential Revision:
D69754858

Privacy Context Container: L1141030

fbshipit-source-id: 3ae0b88fe6a814e586cc436f5819bdae4dd8515d
  • Loading branch information
Alexander Shturm authored and facebook-github-bot committed Feb 18, 2025
1 parent 5cd7141 commit 00f6b13
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/wa_raft_log_ets.erl
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ append_impl(Log, Start, [{Term, _Entry} | Entries], First, Last) when Start =< L
_ -> {mismatch, Start}
end;
append_impl(#raft_log{name = Name}, Start, [_|_] = Entries, _First, Last) when Start =:= Last + 1 ->
true = ets:insert(Name,
lists:zip(
lists:seq(Start, Start + length(Entries) - 1),
Entries)),
true = ets:insert(Name, lists:enumerate(Start, Entries)),
ok;
append_impl(_Log, _Start, [_|_], _First, _Last) ->
{error, invalid_start_index}.
Expand Down

0 comments on commit 00f6b13

Please sign in to comment.