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 12, 2023
1 parent 7b5845c commit fe17e41
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <algorithm>
#include <ranges>
#include <cstring>
#include <cassert>
#include <HyperSonicDrivers/audio/sdl2/Mixer.hpp>
Expand Down Expand Up @@ -145,20 +146,16 @@ namespace HyperSonicDrivers::audio::sdl2
{
std::scoped_lock lck(m_mutex);

for (const auto& ch : m_channels)
if (!ch->isEnded())
return true;

return false;
return std::ranges::any_of(m_channels, [](const auto& ch)
{ return !ch->isEnded(); });
}

bool Mixer::isActive(const mixer::eChannelGroup group)
{
std::scoped_lock lck(m_mutex);

for (const auto& ch : m_channels)
if (ch->getChannelGroup() == group && !ch->isEnded())
return true;
return std::ranges::any_of(m_channels, [group](const auto& ch)
{ return ch->getChannelGroup() == group && !ch->isEnded(); });

return false;
}
Expand Down

0 comments on commit fe17e41

Please sign in to comment.