maths: revert invalid 'simplification' of round_to
This commit is contained in:
parent
4826b4c466
commit
5126bb486c
@ -262,8 +262,11 @@ namespace util {
|
|||||||
>::type
|
>::type
|
||||||
round_to (T value, U size)
|
round_to (T value, U size)
|
||||||
{
|
{
|
||||||
auto remainder = value % size;
|
// we perform this as two steps to avoid unnecessarily incrementing when
|
||||||
return value + size - remainder;
|
// remainder is zero.
|
||||||
|
if (value % size)
|
||||||
|
value += size - value % size;
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user