Skip to content

Commit 49d22b3

Browse files
committed
Simplify verify_args function to fix error C3249
1 parent 6509836 commit 49d22b3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/libipc/mem/verify_args.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ namespace mem {
99
* \brief Check that bytes is not 0 and that the alignment is a power of two.
1010
*/
1111
inline constexpr bool verify_args(std::size_t bytes, std::size_t alignment) noexcept {
12-
if (bytes == 0) {
13-
return false;
14-
}
15-
if ((alignment == 0) || (alignment & (alignment - 1)) != 0) {
16-
return false;
17-
}
18-
return true;
12+
return (bytes > 0) && (alignment > 0) && ((alignment & (alignment - 1)) == 0);
1913
}
2014

2115
} // namespace mem

0 commit comments

Comments
 (0)