Avoid a macro call and mark unlikely paths as unlikely

This commit is contained in:
Chris Robinson 2019-09-12 11:59:36 -07:00
parent 2e010d29cb
commit ac48569c69

View File

@ -253,9 +253,9 @@ START_API_FUNC
ContextRef context{GetContextRef()};
if UNLIKELY(!context) return;
if(n < 0)
SETERR_RETURN(context, AL_INVALID_VALUE,, "Generating %d effect slots", n);
if(n == 0) return;
if UNLIKELY(n < 0)
context->setError(AL_INVALID_VALUE, "Generating %d effect slots", n);
if UNLIKELY(n <= 0) return;
std::unique_lock<std::mutex> slotlock{context->mEffectSlotLock};
ALCdevice *device{context->mDevice.get()};