From 89f67ad6f9878ecfb48b49ce0dd69b9ecb065d0b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 1 May 2023 14:46:26 -0700 Subject: Use a 64-bit value for tracking ID filters --- al/debug.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'al') diff --git a/al/debug.cpp b/al/debug.cpp index 66cbc622..70c7c4db 100644 --- a/al/debug.cpp +++ b/al/debug.cpp @@ -224,29 +224,18 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageControlSOFT(ALenum source, ALenum typ std::lock_guard _{context->mDebugCbLock}; if(count > 0) { - const uint filter{(1u<(count))) { - if(!enable) - { - auto &idfilters = context->mDebugIdFilters[id]; - auto iter = std::lower_bound(idfilters.cbegin(), idfilters.cend(), filter); - if(iter == idfilters.cend() || *iter != filter) - idfilters.insert(iter, filter); - continue; - } - - auto iditer = context->mDebugIdFilters.find(id); - if(iditer == context->mDebugIdFilters.end()) - continue; - auto iter = std::lower_bound(iditer->second.cbegin(), iditer->second.cend(), filter); - if(iter != iditer->second.cend() && *iter == filter) - { - iditer->second.erase(iter); - if(iditer->second.empty()) - context->mDebugIdFilters.erase(iditer); - } + const uint64_t filter{filterbase | (uint64_t{id} << 32)}; + + auto iter = std::lower_bound(context->mDebugIdFilters.cbegin(), + context->mDebugIdFilters.cend(), filter); + if(!enable && (iter == context->mDebugIdFilters.cend() || *iter != filter)) + context->mDebugIdFilters.insert(iter, filter); + else if(enable && iter != context->mDebugIdFilters.cend() && *iter == filter) + context->mDebugIdFilters.erase(iter); } } else -- cgit v1.2.3