From 41be0f53869b2ccf97a6dfed9024b0dd793dd004 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 18 May 2019 16:11:33 +0100 Subject: [PATCH] Problem: new xpub option is in critical path Solution: use unlikely to optimize for the most common case --- src/xpub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xpub.cpp b/src/xpub.cpp index 131d3c90..e2015df7 100644 --- a/src/xpub.cpp +++ b/src/xpub.cpp @@ -282,7 +282,7 @@ int zmq::xpub_t::xsend (msg_t *msg_) // For the first part of multi-part message, find the matching pipes. if (!_more) { - if (_manual && _last_pipe && _send_last_pipe) { + if (unlikely (_manual && _last_pipe && _send_last_pipe)) { _subscriptions.match (static_cast (msg_->data ()), msg_->size (), mark_last_pipe_as_matching, this);