From b7a3c4526990d6601ff2cac748ff860cda6bc16d Mon Sep 17 00:00:00 2001 From: vaxerski Date: Fri, 17 Jan 2025 18:21:34 +0100 Subject: core: add LIKELY and UNLIKELY macros helps the compiler optimize --- src/protocols/WaylandProtocol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/protocols/WaylandProtocol.cpp') diff --git a/src/protocols/WaylandProtocol.cpp b/src/protocols/WaylandProtocol.cpp index 5c6a4a56..7fef5179 100644 --- a/src/protocols/WaylandProtocol.cpp +++ b/src/protocols/WaylandProtocol.cpp @@ -20,7 +20,7 @@ void IWaylandProtocol::onDisplayDestroy() { IWaylandProtocol::IWaylandProtocol(const wl_interface* iface, const int& ver, const std::string& name) : m_szName(name), m_pGlobal(wl_global_create(g_pCompositor->m_sWLDisplay, iface, ver, this, &bindManagerInternal)) { - if (!m_pGlobal) { + if UNLIKELY (!m_pGlobal) { LOGM(ERR, "could not create a global [{}]", m_szName); return; } -- cgit v1.2.3