summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-21 12:10:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-21 18:23:54 +0200
commit1fd6298be955331f64f6f0b2e04675d9914f44e4 (patch)
treed947f57ce19cf6376fb3d9cb78fb51bde1b8e346
parent7f2464c41adf3e45fe020e87198fb0cb939e6e34 (diff)
use SAL_UNLIKELY to make logging a little more efficient
if we have logging compiled into a release build, the most frequent logging (e.g. INFO) is typically off, so most of the time, we are not going to execute the logging. Change-Id: I2b464b4153307df8730998728e508cce09d5013b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/sal/log.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sal/log.hxx b/include/sal/log.hxx
index 5faeec3113dc..a60d8dc24829 100644
--- a/include/sal/log.hxx
+++ b/include/sal/log.hxx
@@ -148,7 +148,7 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) {
#define SAL_DETAIL_LOG_STREAM(condition, level, area, where, stream) \
do { \
- if (condition) \
+ if (SAL_UNLIKELY(condition)) \
{ \
switch (sal_detail_log_report(level, area)) \
{ \