Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WIP (Try wrapping "outer" data in tuples)
  • Loading branch information
lexmag committed Apr 11, 2017
1 parent 4b2dba7 commit 5e3a213
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/msgpax/unpacker.ex
Expand Up @@ -133,7 +133,7 @@ defmodule Msgpax.Unpacker do
options = Macro.var(:options, nil)
outer = Macro.var(:outer, nil)
defp unpack_collection(<<unquote_splicing(format), rest::bits>>, result, options, outer, index, length, kind) when index < length do
outer = [kind, index, length | outer]
outer = [{kind, index, length} | outer]
unquote(pipe(rest, pipe(result, pipe(options, pipe(outer, call, 0), 0), 0), 0))
end
end
Expand Down Expand Up @@ -167,7 +167,7 @@ defmodule Msgpax.Unpacker do
Msgpax.Ext.new(type, data)
end

defp unpack_continue(<<buffer::bits>>, result, options, [kind, index, length | outer]) do
defp unpack_continue(<<buffer::bits>>, result, options, [{kind, index, length} | outer]) do
unpack_collection(buffer, result, options, outer, index + 1, length, kind)
end

Expand Down

0 comments on commit 5e3a213

Please sign in to comment.