core: optimize some common branches

This commit is contained in:
Vaxry 2026-01-16 16:40:48 +01:00
parent 2e697ce2bf
commit eff484b96c
No known key found for this signature in database
GPG key ID: 665806380871D640
3 changed files with 22 additions and 22 deletions

View file

@ -252,8 +252,8 @@ void CHyprAnimationManager::frameTick() {
if (!shouldTickForNext())
return;
if (!g_pCompositor->m_sessionActive || !g_pHookSystem || g_pCompositor->m_unsafeState ||
!std::ranges::any_of(g_pCompositor->m_monitors, [](const auto& mon) { return mon->m_enabled && mon->m_output; }))
if UNLIKELY (!g_pCompositor->m_sessionActive || !g_pHookSystem || g_pCompositor->m_unsafeState ||
!std::ranges::any_of(g_pCompositor->m_monitors, [](const auto& mon) { return mon->m_enabled && mon->m_output; }))
return;
if (!m_lastTickValid || m_lastTickTimer.getMillis() >= 1.0f) {