Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpatek committed Jan 5, 2025
1 parent 1c744fe commit 1b115fc
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,25 @@ namespace sigfn
template <class IteratorType>
void handle_sigset(IteratorType begin, IteratorType end, channels::buffered_channel<int> &channel)
{
if (std::distance(begin, end) == 0)
if (std::distance(begin, end) > 0)
{
std::for_each(
begin,
end,
[&](int signum)
{
sigfn::handle(
signum,
[&](int value)
{
channel.write(value);
});
});
}
else
{
throw std::runtime_error(empty_sigset);
}
std::for_each(
begin,
end,
[&](int signum)
{
sigfn::handle(
signum,
[&](int value)
{
channel.write(value);
});
});
}

template <class F, class... Args>
Expand Down

0 comments on commit 1b115fc

Please sign in to comment.