maths: use mult rather than negation in constexpr

util::digits was triggering signed overflow warnings under gcc. By using
negative multiplication rather than explicit negation we get the same
behaviour, sans warning.
This commit is contained in:
Danny Robson 2016-08-29 14:48:07 +10:00
parent 98c09df7f9
commit 3d5aff0f30

View File

@ -312,7 +312,7 @@ namespace util {
digits (ValueT value, BaseT base) noexcept
{
if (value < 0)
return digits (-value, base);
value *= -1;
unsigned tally = 1;
while (value /= base)