Permalink
Browse files

WIP (Try wrapping "outer" data in tuples)

  • Loading branch information...
lexmag committed Apr 5, 2017
1 parent 4b2dba7 commit 5e3a21333e03f404a2ae1965fe15bb9708bfeefc
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/msgpax/unpacker.ex
@@ -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
@@ -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

0 comments on commit 5e3a213

Please sign in to comment.