Skip to content

Commit

Permalink
Use iolists where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrudel committed Jan 3, 2023
1 parent 84c1f9c commit 922954a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bandit/websocket/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ defmodule Bandit.WebSocket.Connection do
when not is_nil(fragment_frame) do
case frame do
%Frame.Continuation{fin: true} = frame ->
data = connection.fragment_frame.data <> frame.data
data = IO.iodata_to_binary([connection.fragment_frame.data | frame.data])
frame = %{connection.fragment_frame | fin: true, data: data}
handle_frame(frame, socket, %{connection | fragment_frame: nil})

%Frame.Continuation{fin: false} = frame ->
data = connection.fragment_frame.data <> frame.data
data = [connection.fragment_frame.data | frame.data]
frame = %{connection.fragment_frame | fin: true, data: data}
{:continue, %{connection | fragment_frame: frame}}

Expand Down

0 comments on commit 922954a

Please sign in to comment.