From bc27d0387127d00a6fd35d0ed922ec66558106b7 Mon Sep 17 00:00:00 2001 From: preciz Date: Fri, 12 Jun 2026 13:33:06 +0200 Subject: [PATCH] Remove redundant nil check for child_diff child_diff is always a map. --- lib/phoenix_live_view/diff.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phoenix_live_view/diff.ex b/lib/phoenix_live_view/diff.ex index 1bb495e84d..eabb9ab69a 100644 --- a/lib/phoenix_live_view/diff.ex +++ b/lib/phoenix_live_view/diff.ex @@ -791,7 +791,7 @@ defmodule Phoenix.LiveView.Diff do Map.put(new_prints, key, %{index: index, vars: new_vars, child_prints: child_prints}) # if the diff is empty, we need to check if the item moved - if child_diff == %{} or child_diff == nil do + if child_diff == %{} do # check if the entry moved, then annotate it with the previous index diff = if previous_index != index, do: Map.put(diff, index, previous_index), else: diff {diff, index + 1, new_prints, pending, components, template}