From fcd8c4e1f91feab8990e314664b61298dbb5bc18 Mon Sep 17 00:00:00 2001 From: saker Date: Mon, 3 Feb 2025 17:18:29 -0500 Subject: [PATCH] Use static initialization --- plugins/Sid/SidInstrument.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index aaec7049e85..9a5a74f7158 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -128,10 +128,10 @@ SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) : m_volumeModel( 15.0f, 0.0f, 15.0f, 1.0f, this, tr( "Volume" ) ), m_chipModel( static_cast(ChipModel::MOS8580), 0, NumChipModels-1, this, tr( "Chip model" ) ) { - // A Filter object needs to be created only once to do some static initialization and avoid - // dropouts down the line when we have to play a note for the first time. - static auto s_init = std::once_flag{}; - std::call_once(s_init, [] { reSID::Filter{}; }); + // A Filter object needs to be created only once to do some initialization, avoiding + // dropouts down the line when we have to play a note for the first time. + [[maybe_unused]] static auto s_filter = reSID::Filter{}; + for( int i = 0; i < 3; ++i ) { m_voice[i] = new VoiceObject( this, i );