From 1b115fc561d0db46bceafe7200a30aedad51bd85 Mon Sep 17 00:00:00 2001 From: John R Patek Sr Date: Sun, 5 Jan 2025 10:17:03 -0600 Subject: [PATCH] added more tests --- src/internal.hpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/internal.hpp b/src/internal.hpp index f0fd783..650a50f 100644 --- a/src/internal.hpp +++ b/src/internal.hpp @@ -55,22 +55,25 @@ namespace sigfn template void handle_sigset(IteratorType begin, IteratorType end, channels::buffered_channel &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