factor: a bit more simple isqrt
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 9 Apr 2017 22:28:26 +0000 (00:28 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 9 Apr 2017 22:28:26 +0000 (00:28 +0200)
function                                             old     new   delta
isqrt_odd                                             87      80      -7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/factor.c

index 48833e10361a389cdf84632c427dd78a54635379..8ca3de71aafce2e11d9c60d535193bde95e194bb 100644 (file)
@@ -62,7 +62,7 @@ static inline half_t isqrt(wide_t N)
         */
        x = HALF_MAX;
        mask_2bits = TOPMOST_WIDE_BIT | (TOPMOST_WIDE_BIT >> 1);
-       while (mask_2bits && !(N & mask_2bits)) {
+       while (!(N & mask_2bits)) {
                x >>= 1;
                mask_2bits >>= 2;
        }