mood.c: Trivial cosmetics for int_sqrt().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 24 Jul 2017 20:44:54 +0000 (22:44 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 28 Jul 2017 14:01:01 +0000 (16:01 +0200)
This saves two lines, fixes a whitespace issue, and removes a line
which was commented out for many years.

mood.c

diff --git a/mood.c b/mood.c
index bf6b3c9c9992afd04b791af9c281eaf417fc376f..e9c5bd6e0e60ca55e5fc3bb4e67234bdf51fc193 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -127,20 +127,17 @@ __a_const static uint32_t fls64(uint64_t v)
  */
 __a_const static uint64_t int_sqrt(uint64_t x)
 {
  */
 __a_const static uint64_t int_sqrt(uint64_t x)
 {
-       uint64_t op, res, one = 1;
-       op = x;
-       res = 0;
+       uint64_t op = x, res = 0, one = 1;
 
        one = one << (fls64(x) & ~one);
        while (one != 0) {
                if (op >= res + one) {
                        op = op - (res + one);
 
        one = one << (fls64(x) & ~one);
        while (one != 0) {
                if (op >= res + one) {
                        op = op - (res + one);
-                       res = res +  2 * one;
+                       res = res + 2 * one;
                }
                res /= 2;
                one /= 4;
        }
                }
                res /= 2;
                one /= 4;
        }
-//     PARA_NOTICE_LOG("sqrt(%llu) = %llu\n", x, res);
        return res;
 }
 
        return res;
 }