diff --git a/src/libipc/mem/verify_args.h b/src/libipc/mem/verify_args.h index ab43cc1..a818bb5 100644 --- a/src/libipc/mem/verify_args.h +++ b/src/libipc/mem/verify_args.h @@ -9,13 +9,7 @@ namespace mem { * \brief Check that bytes is not 0 and that the alignment is a power of two. */ inline constexpr bool verify_args(std::size_t bytes, std::size_t alignment) noexcept { - if (bytes == 0) { - return false; - } - if ((alignment == 0) || (alignment & (alignment - 1)) != 0) { - return false; - } - return true; + return (bytes > 0) && (alignment > 0) && ((alignment & (alignment - 1)) == 0); } } // namespace mem