[git commit] factor: a bit more simple isqrt

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 9 22:28:26 UTC 2017


commit: https://git.busybox.net/busybox/commit/?id=bef17132175945a121992e3d13f0cc78ae722b1b
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
isqrt_odd                                             87      80      -7

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/factor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coreutils/factor.c b/coreutils/factor.c
index 48833e1..8ca3de7 100644
--- a/coreutils/factor.c
+++ b/coreutils/factor.c
@@ -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;
 	}


More information about the busybox-cvs mailing list