core: add LIKELY and UNLIKELY macros

helps the compiler optimize
This commit is contained in:
vaxerski 2025-01-17 18:21:34 +01:00
parent 2bad73354a
commit b7a3c45269
58 changed files with 395 additions and 396 deletions

View file

@ -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;
}