From 4cbb2718198c2f2ed1117260e84c970be4e67c33 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 16 Jul 2022 11:27:23 -0700 Subject: Avoid duplicate initializations for multiple filters Just initialize the first and copy it to the others. --- core/hrtf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/hrtf.cpp b/core/hrtf.cpp index d4d69815..1903898e 100644 --- a/core/hrtf.cpp +++ b/core/hrtf.cpp @@ -269,10 +269,11 @@ void DirectHrtfState::build(const HrtfStore *Hrtf, const uint irSize, }; const double xover_norm{double{XOverFreq} / Hrtf->sampleRate}; + mChannels[0].mSplitter.init(static_cast(xover_norm)); for(size_t i{0};i < mChannels.size();++i) { const size_t order{AmbiIndex::OrderFromChannel()[i]}; - mChannels[i].mSplitter.init(static_cast(xover_norm)); + mChannels[i].mSplitter = mChannels[0].mSplitter; mChannels[i].mHfScale = AmbiOrderHFGain[order]; } -- cgit v1.2.3