diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-12-18 22:11:20 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-12-19 11:20:39 -0500 |
commit | 1d841eeb876082d9efbf2fa7f04bccc259f40ef9 (patch) | |
tree | 00785dbc4dbba6c29a3760058beb5629003210a4 /klippy/stepcompress.c | |
parent | 19d1f83d976ada91c81d509af2aeafae25e64fae (diff) | |
download | kutter-1d841eeb876082d9efbf2fa7f04bccc259f40ef9.tar.gz kutter-1d841eeb876082d9efbf2fa7f04bccc259f40ef9.tar.xz kutter-1d841eeb876082d9efbf2fa7f04bccc259f40ef9.zip |
stepcompress: Prefer greater interval if all else equal
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/stepcompress.c')
-rw-r--r-- | klippy/stepcompress.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/stepcompress.c b/klippy/stepcompress.c index 75e8e819..34578935 100644 --- a/klippy/stepcompress.c +++ b/klippy/stepcompress.c @@ -164,7 +164,8 @@ compress_bisect_add(struct stepcompress *sc) // Check if this is the best sequence found so far int32_t count = nextcount - 1, addfactor = count*(count-1)/2; int32_t reach = add*addfactor + interval*count; - if (reach > bestreach) { + if (reach > bestreach + || (reach == bestreach && interval > bestinterval)) { bestinterval = interval; bestcount = count; bestadd = add; |