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.
This commit is contained in:
Willy Tarreau 2012-12-16 19:39:09 +01:00
parent 7d28149e92
commit 5fb3803f4b
4 changed files with 4 additions and 4 deletions

View File

@ -327,7 +327,7 @@ static inline void bo_skip(struct channel *chn, int len)
{
chn->buf->o -= len;
if (buffer_len(chn->buf) == 0)
if (buffer_empty(chn->buf))
chn->buf->p = chn->buf->data;
/* notify that some data was written to the SI from the buffer */

View File

@ -63,7 +63,7 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int
b->i += delta;
if (buffer_len(b) == 0)
if (buffer_empty(b))
b->p = b->data;
return delta;

View File

@ -331,7 +331,7 @@ static int raw_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
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;

View File

@ -1167,7 +1167,7 @@ static int ssl_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
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;