Skip to content

Commit 69cd8df

Browse files
committed
Keep argument order in unpack_continue/5 intact
It eliminates 4 "move" instructions in the assembly.
1 parent fecc6c0 commit 69cd8df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/msgpax/unpacker.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,23 +141,23 @@ defmodule Msgpax.Unpacker do
141141
defp unpack_continue(rest, result, options, outer, index, count) do
142142
case index + 1 do
143143
^count ->
144-
unpack_continue(rest, options, outer, result, count)
144+
unpack_continue(rest, result, options, outer, count)
145145
index ->
146146
unpack(rest, result, options, outer, index, count)
147147
end
148148
end
149149

150-
defp unpack_continue(<<buffer::bits>>, options, [kind, index, length | outer], result, count) do
150+
defp unpack_continue(<<buffer::bits>>, result, options, [kind, index, length | outer], count) do
151151
result = build_collection(result, count, kind)
152152
case index + 1 do
153153
^length ->
154-
unpack_continue(buffer, options, outer, result, length)
154+
unpack_continue(buffer, result, options, outer, length)
155155
index ->
156156
unpack(buffer, result, options, outer, index, length)
157157
end
158158
end
159159

160-
defp unpack_continue(<<buffer::bits>>, _options, [], [value], 1) do
160+
defp unpack_continue(<<buffer::bits>>, [value], _options, [], 1) do
161161
{value, buffer}
162162
end
163163

0 commit comments

Comments
 (0)