From: Timo Sirainen Date: Wed, 11 Sep 2019 08:11:57 +0000 (+0300) Subject: lib: i_stream_get_data() - Mark invalid buffer code path unlikely X-Git-Tag: 2.3.9~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed4e139c58cb949dae43a53d57a0790c38b95d95;p=thirdparty%2Fdovecot%2Fcore.git lib: i_stream_get_data() - Mark invalid buffer code path unlikely This really isn't expected to happen, so marking it unlikely optimizes slightly callers that cause i_stream_get_data() to be called a huge number of times. --- diff --git a/src/lib/istream.c b/src/lib/istream.c index 161f4a6b2f..83b8008495 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -679,7 +679,7 @@ i_stream_get_data(struct istream *stream, size_t *size_r) return uchar_empty_ptr; } - if (i_stream_is_buffer_invalid(_stream)) { + if (unlikely(i_stream_is_buffer_invalid(_stream))) { /* This stream may be using parent's buffer directly as _stream->buffer, but the parent stream has already been modified indirectly. This means that the buffer might no