mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-17 13:03:48 -07:00
core: add LIKELY and UNLIKELY macros
helps the compiler optimize
This commit is contained in:
@@ -10,7 +10,7 @@ void CTextInputV3::SState::reset() {
|
||||
}
|
||||
|
||||
CTextInputV3::CTextInputV3(SP<CZwpTextInputV3> resource_) : resource(resource_) {
|
||||
if (!resource->resource())
|
||||
if UNLIKELY (!resource->resource())
|
||||
return;
|
||||
|
||||
LOGM(LOG, "New tiv3 at {:016x}", (uintptr_t)this);
|
||||
@@ -129,7 +129,7 @@ void CTextInputV3Protocol::onGetTextInput(CZwpTextInputManagerV3* pMgr, uint32_t
|
||||
const auto CLIENT = pMgr->client();
|
||||
const auto RESOURCE = m_vTextInputs.emplace_back(makeShared<CTextInputV3>(makeShared<CZwpTextInputV3>(CLIENT, pMgr->version(), id)));
|
||||
|
||||
if (!RESOURCE->good()) {
|
||||
if UNLIKELY (!RESOURCE->good()) {
|
||||
pMgr->noMemory();
|
||||
m_vTextInputs.pop_back();
|
||||
LOGM(ERR, "Failed to create a tiv3 resource");
|
||||
|
Reference in New Issue
Block a user