Skip to content

Commit

Permalink
Remove useless delegation in ErlangArray implementation of Arrays.Pro…
Browse files Browse the repository at this point in the history
…tocol
  • Loading branch information
Qqwy committed Sep 6, 2021
1 parent 6c68914 commit 66c0d91
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/arrays/implementations/erlang_array.ex
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ defmodule Arrays.Implementations.ErlangArray do
end

@impl true
defdelegate replace(array, index, element), to: __MODULE__, as: :set

def set(array = %ErlangArray{contents: contents}, index, item) do
def replace(array = %ErlangArray{contents: contents}, index, item) do
new_contents =
if index < 0 do
:array.set(index + :array.size(contents), item, contents)
Expand Down

0 comments on commit 66c0d91

Please sign in to comment.