mirror of
https://github.com/ash-project/igniter.git
synced 2024-09-19 13:02:51 +12:00
fix: detect equal lists for node equality
This commit is contained in:
parent
678ff157ce
commit
077f8517db
1 changed files with 6 additions and 2 deletions
|
@ -721,7 +721,7 @@ defmodule Igniter.Code.Common do
|
|||
extendable_block?(left) ->
|
||||
case left do
|
||||
{:__block__, _, [left]} ->
|
||||
equal_vals?(left, right)
|
||||
nodes_equal?(left, right)
|
||||
|
||||
_ ->
|
||||
false
|
||||
|
@ -730,12 +730,16 @@ defmodule Igniter.Code.Common do
|
|||
extendable_block?(right) ->
|
||||
case right do
|
||||
{:__block__, _, [right]} ->
|
||||
equal_vals?(left, right)
|
||||
nodes_equal?(left, right)
|
||||
|
||||
_ ->
|
||||
false
|
||||
end
|
||||
|
||||
is_list(left) and is_list(right) ->
|
||||
length(left) == length(right) and
|
||||
Enum.all?(Enum.zip(left, right), fn {l, r} -> nodes_equal?(l, r) end)
|
||||
|
||||
true ->
|
||||
false
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue