Skip to content

Commit

Permalink
sonarcloud code rev
Browse files Browse the repository at this point in the history
  • Loading branch information
Raffaello committed Nov 5, 2023
1 parent 66656a5 commit 3f0d9f4
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -23,10 +23,10 @@ namespace HyperSonicDrivers::drivers

bool PCMDriver::isPlaying(const std::shared_ptr<audio::PCMSound>& 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;
Expand Down Expand Up @@ -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_();
}
Expand Down

0 comments on commit 3f0d9f4

Please sign in to comment.