From cfb6bdfabfdf70ce5bcb650d356c3a9c1db3df0c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 23 Dec 2023 04:18:07 -0800 Subject: Avoid assignments in if conditions --- al/source.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'al') diff --git a/al/source.cpp b/al/source.cpp index c99943cf..f119ee36 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -3410,8 +3410,8 @@ FORCE_ALIGN void AL_APIENTRY alSourceQueueBuffersDirect(ALCcontext *context, ALu for(ALsizei i{0};i < nb;i++) { bool fmt_mismatch{false}; - ALbuffer *buffer{nullptr}; - if(buffers[i] && (buffer=LookupBuffer(device, buffers[i])) == nullptr) + ALbuffer *buffer{buffers[i] ? LookupBuffer(device, buffers[i]) : nullptr}; + if(buffers[i] && !buffer) { context->setError(AL_INVALID_NAME, "Queueing invalid buffer ID %u", buffers[i]); goto buffer_error; -- cgit v1.2.3