From 8a134ec68075fc2fd415558bcf6a37cda3ff285f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 11 Apr 2017 07:34:56 +0200 Subject: libbb: move isqrt from factor, use it in diff too Signed-off-by: Denys Vlasenko --- editors/diff.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'editors/diff.c') diff --git a/editors/diff.c b/editors/diff.c index 0eb825cfb..3304edb26 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -295,17 +295,6 @@ static int search(const int *c, int k, int y, const struct cand *list) } } -static unsigned isqrt(unsigned n) -{ - unsigned x = 1; - while (1) { - const unsigned y = x; - x = ((n / x) + x) >> 1; - if (x <= (y + 1) && x >= (y - 1)) - return x; - } -} - static void stone(const int *a, int n, const int *b, int *J, int pref) { const unsigned isq = isqrt(n); -- cgit v1.2.3