diff options
author | Chris Robinson <[email protected]> | 2023-03-11 18:15:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-11 18:15:59 -0800 |
commit | 3f45b3c0c900a6b513d8917cc4df00ca100a7c09 (patch) | |
tree | 372224c950b7fc1be7efc70bff9dea5129297c55 /al/effects/echo.cpp | |
parent | 368b3db4ebf0284ef9a069bbb1c1387aa1800e82 (diff) |
Avoid copying to a temporary
Diffstat (limited to 'al/effects/echo.cpp')
-rw-r--r-- | al/effects/echo.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/al/effects/echo.cpp b/al/effects/echo.cpp index be12c621..2eb37603 100644 --- a/al/effects/echo.cpp +++ b/al/effects/echo.cpp @@ -204,21 +204,20 @@ template<> template<> bool EchoCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType && mEaxProps.mEcho.flDelay == props.mEcho.flDelay + if(props.mType == mEaxProps.mType && mEaxProps.mEcho.flDelay == props.mEcho.flDelay && mEaxProps.mEcho.flLRDelay == props.mEcho.flLRDelay && mEaxProps.mEcho.flDamping == props.mEcho.flDamping && mEaxProps.mEcho.flFeedback == props.mEcho.flFeedback && mEaxProps.mEcho.flSpread == props.mEcho.flSpread) return false; - mAlProps.Echo.Delay = mEaxProps.mEcho.flDelay; - mAlProps.Echo.LRDelay = mEaxProps.mEcho.flLRDelay; - mAlProps.Echo.Damping = mEaxProps.mEcho.flDamping; - mAlProps.Echo.Feedback = mEaxProps.mEcho.flFeedback; - mAlProps.Echo.Spread = mEaxProps.mEcho.flSpread; + mEaxProps = props; + + mAlProps.Echo.Delay = props.mEcho.flDelay; + mAlProps.Echo.LRDelay = props.mEcho.flLRDelay; + mAlProps.Echo.Damping = props.mEcho.flDamping; + mAlProps.Echo.Feedback = props.mEcho.flFeedback; + mAlProps.Echo.Spread = props.mEcho.flSpread; return true; } |