OPTIM: buffer: remove one jump in buffer_count()
We can help gcc build an expression not involving a jump. This function
is used a lot when parsing chunks.
diff --git a/include/common/buffer.h b/include/common/buffer.h
index d46495c..18ced91 100644
--- a/include/common/buffer.h
+++ b/include/common/buffer.h
@@ -272,8 +272,8 @@
static inline int buffer_count(const struct buffer *buf, const char *from, const char *to)
{
int count = to - from;
- if (count < 0)
- count += buf->size;
+
+ count += count < 0 ? buf->size : 0;
return count;
}