We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6509836 commit 49d22b3Copy full SHA for 49d22b3
src/libipc/mem/verify_args.h
@@ -9,13 +9,7 @@ namespace mem {
9
* \brief Check that bytes is not 0 and that the alignment is a power of two.
10
*/
11
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
17
18
- return true;
+ return (bytes > 0) && (alignment > 0) && ((alignment & (alignment - 1)) == 0);
19
}
20
21
} // namespace mem
0 commit comments