aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/pshifter.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-03-11 18:15:59 -0800
committerChris Robinson <[email protected]>2023-03-11 18:15:59 -0800
commit3f45b3c0c900a6b513d8917cc4df00ca100a7c09 (patch)
tree372224c950b7fc1be7efc70bff9dea5129297c55 /al/effects/pshifter.cpp
parent368b3db4ebf0284ef9a069bbb1c1387aa1800e82 (diff)
Avoid copying to a temporary
Diffstat (limited to 'al/effects/pshifter.cpp')
-rw-r--r--al/effects/pshifter.cpp11
1 files changed, 5 insertions, 6 deletions
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<ALint>(mEaxProps.mPitchShifter.lCoarseTune);
- mAlProps.Pshifter.FineTune = static_cast<ALint>(mEaxProps.mPitchShifter.lFineTune);
+ mEaxProps = props;
+
+ mAlProps.Pshifter.CoarseTune = static_cast<int>(mEaxProps.mPitchShifter.lCoarseTune);
+ mAlProps.Pshifter.FineTune = static_cast<int>(mEaxProps.mPitchShifter.lFineTune);
return true;
}