mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 15:00:38 +02:00
The function is an exact copy of b_peek_varint() with ofs==0 and doing a b_del() at the end. We can simply call that other one and delete the contents. It turns out that the code is bigger with this change because b_peek_varint() passes its offset to b_peek() which performs a wrapping check. When ofs==0 the wrapping cannot happen, but there's no real way to tell that to the compiler. Instead conditioning the if() in b_peek() with (!__builtin_constant_p(ofs) || ofs) does the job, but it's not worth it at the moment since we have no users of b_get_varint() for now. Let's just stick to the simple normal code.