Skip to content

Commit

Permalink
Simplify decoding logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Argonus committed Jan 23, 2024
1 parent 4aef47a commit 53d26fd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/kayrock/message_set.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,11 @@ defmodule Kayrock.MessageSet do
}

c ->
decompressed = Kayrock.Compression.decompress(c, value)

if magic == 1 do
decompressed
|> do_deserialize([], 0)
|> correct_offsets(offset)
|> Enum.reverse()
else
Enum.reverse(do_deserialize(decompressed, [], 0))
end
c
|> Kayrock.Compression.decompress(value)
|> do_deserialize([], 0)
|> correct_offsets(offset)
|> Enum.reverse()
end

do_deserialize(orig_rest, [msg | acc], add_offset)
Expand Down

0 comments on commit 53d26fd

Please sign in to comment.