From 3f45b3c0c900a6b513d8917cc4df00ca100a7c09 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 11 Mar 2023 18:15:59 -0800 Subject: Avoid copying to a temporary --- al/effects/pshifter.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'al/effects/pshifter.cpp') diff --git a/al/effects/pshifter.cpp b/al/effects/pshifter.cpp index 7c9f0b0e..634eb186 100644 --- a/al/effects/pshifter.cpp +++ b/al/effects/pshifter.cpp @@ -141,16 +141,15 @@ template<> template<> bool PitchShifterCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType + if(props.mType == mEaxProps.mType && mEaxProps.mPitchShifter.lCoarseTune == props.mPitchShifter.lCoarseTune && mEaxProps.mPitchShifter.lFineTune == props.mPitchShifter.lFineTune) return false; - mAlProps.Pshifter.CoarseTune = static_cast(mEaxProps.mPitchShifter.lCoarseTune); - mAlProps.Pshifter.FineTune = static_cast(mEaxProps.mPitchShifter.lFineTune); + mEaxProps = props; + + mAlProps.Pshifter.CoarseTune = static_cast(mEaxProps.mPitchShifter.lCoarseTune); + mAlProps.Pshifter.FineTune = static_cast(mEaxProps.mPitchShifter.lFineTune); return true; } -- cgit v1.2.3