egs_network: Match as binary instead of bits to avoid calculating the bit size.
This commit is contained in:
parent
b380fe9d23
commit
0f64bea72d
@ -103,6 +103,5 @@ split(Data, Acc) when byte_size(Data) < 4 ->
|
||||
split(<< Size:32/little, _/bits >> = Data, Acc) when Size > byte_size(Data) ->
|
||||
{lists:reverse(Acc), Data};
|
||||
split(<< Size:32/little, _/bits >> = Data, Acc) ->
|
||||
BitSize = Size * 8,
|
||||
<< Split:BitSize/bits, Rest/bits >> = Data,
|
||||
<< Split:Size/binary, Rest/bits >> = Data,
|
||||
split(Rest, [Split|Acc]).
|
||||
|
Loading…
Reference in New Issue
Block a user