summaryrefslogtreecommitdiff
path: root/editors/diff.c
diff options
context:
space:
mode:
authorDenys Vlasenko2017-04-11 07:34:56 +0200
committerDenys Vlasenko2017-04-11 07:34:56 +0200
commit8a134ec68075fc2fd415558bcf6a37cda3ff285f (patch)
treee6c4927ebcb071b6dcb6e9832ebe6d7f4b721461 /editors/diff.c
parent10673c44f11045a0c99b19f32930097e9b3ae148 (diff)
downloadbusybox-8a134ec68075fc2fd415558bcf6a37cda3ff285f.zip
busybox-8a134ec68075fc2fd415558bcf6a37cda3ff285f.tar.gz
libbb: move isqrt from factor, use it in diff too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/diff.c')
-rw-r--r--editors/diff.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/editors/diff.c b/editors/diff.c
index 0eb825c..3304edb 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);