Skip to content

Commit 068692e

Browse files
precizSteffenDE
authored andcommitted
Optimize implicit inner block slots_defs check (#4176)
Use `slots_defs != []` instead of `length(slots_defs) > 0` in `Phoenix.Component.Declarative` for a minor optimization.
1 parent 39b59a0 commit 068692e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/phoenix_component/declarative.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ defmodule Phoenix.Component.Declarative do
12701270
end
12711271

12721272
defp implicit_inner_block?(slot_name, slots_defs) do
1273-
slot_name == :inner_block and length(slots_defs) > 0
1273+
slot_name == :inner_block and slots_defs != []
12741274
end
12751275

12761276
defp type_mismatch(:any, _type_value), do: nil

0 commit comments

Comments
 (0)