17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 15:07:29 +01:00

refactor(sonar): use std::ranges algorithms and std::erase(_if) (cpp:S6197)

This commit is contained in:
jerrrrycho
2026-10-10 16:24:06 +02:00
parent 9a674b4944
commit d0a6353449
9 changed files with 25 additions and 38 deletions

View File

@@ -52,9 +52,8 @@ sound_source::deserialize( cParser &Input, sound_type const Legacytype, int cons
if( false == m_soundchunks.empty() ) {
// arrange loaded sound chunks in requested order
std::sort(
std::begin( m_soundchunks ), std::end( m_soundchunks ),
[]( soundchunk_pair const &Left, soundchunk_pair const &Right ) {
std::ranges::sort(
m_soundchunks, []( soundchunk_pair const &Left, soundchunk_pair const &Right ) {
return Left.second.threshold < Right.second.threshold; } );
// calculate and cache full range points for each chunk, including crossfade sections:
// on the far end the crossfade section extends to the threshold point of the next chunk...