From 077f8517db06f52c28240d94d77f7fcbef19655f Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 26 Aug 2024 16:53:48 -0400 Subject: [PATCH] fix: detect equal lists for node equality --- lib/igniter/code/common.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/igniter/code/common.ex b/lib/igniter/code/common.ex index ac6cea6..6bced07 100644 --- a/lib/igniter/code/common.ex +++ b/lib/igniter/code/common.ex @@ -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