diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-04-11 07:34:56 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-04-11 07:34:56 +0200 |
| commit | 8a134ec68075fc2fd415558bcf6a37cda3ff285f (patch) | |
| tree | e6c4927ebcb071b6dcb6e9832ebe6d7f4b721461 /editors/diff.c | |
| parent | 10673c44f11045a0c99b19f32930097e9b3ae148 (diff) | |
| download | busybox-w32-8a134ec68075fc2fd415558bcf6a37cda3ff285f.tar.gz busybox-w32-8a134ec68075fc2fd415558bcf6a37cda3ff285f.tar.bz2 busybox-w32-8a134ec68075fc2fd415558bcf6a37cda3ff285f.zip | |
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.c | 11 |
1 files changed, 0 insertions, 11 deletions
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) | |||
| 295 | } | 295 | } |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | static unsigned isqrt(unsigned n) | ||
| 299 | { | ||
| 300 | unsigned x = 1; | ||
| 301 | while (1) { | ||
| 302 | const unsigned y = x; | ||
| 303 | x = ((n / x) + x) >> 1; | ||
| 304 | if (x <= (y + 1) && x >= (y - 1)) | ||
| 305 | return x; | ||
| 306 | } | ||
| 307 | } | ||
| 308 | |||
| 309 | static void stone(const int *a, int n, const int *b, int *J, int pref) | 298 | static void stone(const int *a, int n, const int *b, int *J, int pref) |
| 310 | { | 299 | { |
| 311 | const unsigned isq = isqrt(n); | 300 | const unsigned isq = isqrt(n); |
