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