mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-09 00:21:56 -07:00
core: add LIKELY and UNLIKELY macros
helps the compiler optimize
This commit is contained in:
@@ -15,7 +15,7 @@ bool CAlphaModifier::good() {
|
||||
void CAlphaModifier::setResource(SP<CWpAlphaModifierSurfaceV1> resource) {
|
||||
m_pResource = std::move(resource);
|
||||
|
||||
if (!m_pResource->resource())
|
||||
if UNLIKELY (!m_pResource->resource())
|
||||
return;
|
||||
|
||||
m_pResource->setDestroy([this](CWpAlphaModifierSurfaceV1* resource) { destroy(); });
|
||||
@@ -98,7 +98,7 @@ void CAlphaModifierProtocol::getSurface(CWpAlphaModifierV1* manager, uint32_t id
|
||||
.first->second.get();
|
||||
}
|
||||
|
||||
if (!alphaModifier->good()) {
|
||||
if UNLIKELY (!alphaModifier->good()) {
|
||||
manager->noMemory();
|
||||
m_mAlphaModifiers.erase(surface);
|
||||
}
|
||||
|
Reference in New Issue
Block a user