From 3f0d9f40ebab643ec7bc9e5ea6a6df8052121794 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Sun, 5 Nov 2023 14:11:14 +0000 Subject: [PATCH] sonarcloud code rev --- .../src/HyperSonicDrivers/drivers/PCMDriver.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp index ffefd02d..37110ddc 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp @@ -12,9 +12,9 @@ namespace HyperSonicDrivers::drivers bool PCMDriver::isPlaying() const noexcept { - for (const auto& ss : m_PCMStreams_channels) + for (const auto& [stream, _] : m_PCMStreams_channels) { - if (isPCMStreamPlaying_(ss.first)) + if (isPCMStreamPlaying_(stream)) return true; } @@ -23,10 +23,10 @@ namespace HyperSonicDrivers::drivers bool PCMDriver::isPlaying(const std::shared_ptr& sound) const noexcept { - for (const auto& ss : m_PCMStreams_channels) + for (const auto& [stream, _] : m_PCMStreams_channels) { - if (ss.first->getSound() == sound) - return isPCMStreamPlaying_(ss.first); + if (stream->getSound() == sound) + return isPCMStreamPlaying_(stream); } return false; @@ -92,10 +92,8 @@ namespace HyperSonicDrivers::drivers void PCMDriver::stop() noexcept { - for (const auto& ss : m_PCMStreams_channels) - { - stop(ss.second, false); - } + for (const auto& [_, ch_id] : m_PCMStreams_channels) + stop(ch_id, false); releaseStreams_(); }