From 0f64bea72dfe5e80f83753ea75850e3c9b584165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 20 Feb 2011 00:37:18 +0100 Subject: [PATCH] egs_network: Match as binary instead of bits to avoid calculating the bit size. --- src/egs_network.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/egs_network.erl b/src/egs_network.erl index 2fe6453..6fba812 100644 --- a/src/egs_network.erl +++ b/src/egs_network.erl @@ -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]).