CLEANUP: buffer: use buffer_empty() instead of buffer_len()==0
A few places still made use of buffer_len()==0 to detect an empty
buffer. Use the cleaner and more efficient buffer_empty() instead.
diff --git a/src/buffer.c b/src/buffer.c
index d7f7ae1..60fb3fc 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -63,7 +63,7 @@
b->i += delta;
- if (buffer_len(b) == 0)
+ if (buffer_empty(b))
b->p = b->data;
return delta;
diff --git a/src/raw_sock.c b/src/raw_sock.c
index 4c83a6f..20a867a 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -331,7 +331,7 @@
buf->o -= ret;
done += ret;
- if (likely(!buffer_len(buf)))
+ if (likely(buffer_empty(buf)))
/* optimize data alignment in the buffer */
buf->p = buf->data;
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 99f22f6..3e74ce5 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -1167,7 +1167,7 @@
buf->o -= ret;
done += ret;
- if (likely(!buffer_len(buf)))
+ if (likely(buffer_empty(buf)))
/* optimize data alignment in the buffer */
buf->p = buf->data;