diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2018-11-12 00:32:18 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2018-11-12 21:56:05 -0500 |
commit | 31d16af78b017c81702d23fb71ecd74ef73484ab (patch) | |
tree | c6812f7a21dbcbc3b7408d1fcbe6627e5516deb6 /src/buffer.h | |
parent | 1539cbfdc1f12620fe1bb78a44b8253d351a6db8 (diff) | |
download | lighttpd-git-31d16af78b017c81702d23fb71ecd74ef73484ab.tar.gz |
[core] perf: simpler buffer_string_space()
Diffstat (limited to 'src/buffer.h')
-rw-r--r-- | src/buffer.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/buffer.h b/src/buffer.h index f4f6556f..90473dfd 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -194,9 +194,7 @@ static inline size_t buffer_string_length(const buffer *b) { } static inline size_t buffer_string_space(const buffer *b) { - if (NULL == b || b->size == 0) return 0; - if (0 == b->used) return b->size - 1; - return b->size - b->used; + return NULL != b ? b->size - (0 != b->used) : 0; } static inline void buffer_append_string_buffer(buffer *b, const buffer *src) { |