Skip to content

Commit 1c3c600

Browse files
committed
Avoid runtime list concatenation in static data_attrs
Allows the compiler to emit native put_list instructions.
1 parent 4e70482 commit 1c3c600

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/phoenix_live_view/static.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ defmodule Phoenix.LiveView.Static do
159159
phx_static: sign_static_token(socket)
160160
]
161161

162-
data_attrs = if(router, do: [phx_main: true], else: []) ++ data_attrs
162+
data_attrs = if router, do: [phx_main: true] ++ data_attrs, else: data_attrs
163163

164164
attrs = [
165165
{:id, socket.id},

0 commit comments

Comments
 (0)