From 3f45b3c0c900a6b513d8917cc4df00ca100a7c09 Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Sat, 11 Mar 2023 18:15:59 -0800 Subject: Avoid copying to a temporary --- al/effects/compressor.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'al/effects/compressor.cpp') diff --git a/al/effects/compressor.cpp b/al/effects/compressor.cpp index 2d219df6..a4aa8e77 100644 --- a/al/effects/compressor.cpp +++ b/al/effects/compressor.cpp @@ -118,12 +118,13 @@ template<> template<> bool CompressorCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - if(orig.mType == mEaxProps.mType && orig.mCompressor.ulOnOff == mEaxProps.mCompressor.ulOnOff) + if(props.mType == mEaxProps.mType + && props.mCompressor.ulOnOff == mEaxProps.mCompressor.ulOnOff) return false; - mAlProps.Compressor.OnOff = (mEaxProps.mCompressor.ulOnOff != 0); + mEaxProps = props; + + mAlProps.Compressor.OnOff = (props.mCompressor.ulOnOff != 0); return true; } -- cgit v1.2.3