Parsing null terminated strings in a binary.
Thu Jan 13 15:49:51 CET 2005
sorry to keep harping on this...
...but would it be (noticably) faster to move the call to size/1 outside the loop?
or equivalently, how fast is size/1 (compared to the binary match)?
i would guess plenty fast but i'm too lazy to try it.
Raimo Niskanen wrote:
> You are missing nothing. The code just evolved in my head to
> what it became - some cruft was left. This might be even clearer
> z_split(B, N) when is_binary(B), is_integer(N) ->
> case B of
> <<B1:N/binary,0,B2/binary>> ->
> _ when size(B) > N
> z_split(B, N+1);
> _ ->
More information about the erlang-questions