Skip to content

Commit 33256f5

Browse files
committed
Prefer value over reference for isPowerOf2
It's questionable whether we should ever have taken a reference instead of a value type here, but since 02bb629 `isPowerOf2` is only available for integral types. Thus, take a value instead of a reference since we will never need reference semantics, and don't ever expect to be passing large arguments.
1 parent 0a11fb4 commit 33256f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/ur/ur.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ roundToHighestFactorOfGlobalSize(size_t &ThreadsPerBlockInDim,
337337

338338
// Returns whether or not Value is a power of 2
339339
template <typename T, typename = std::enable_if_t<std::is_integral_v<T>>>
340-
bool isPowerOf2(const T &Value) {
340+
bool isPowerOf2(const T Value) {
341341
return Value && !(Value & (Value - 1));
342342
}
343343

0 commit comments

Comments
 (0)