aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-18 22:11:20 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-19 11:20:39 -0500
commit1d841eeb876082d9efbf2fa7f04bccc259f40ef9 (patch)
tree00785dbc4dbba6c29a3760058beb5629003210a4
parent19d1f83d976ada91c81d509af2aeafae25e64fae (diff)
downloadkutter-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>
-rw-r--r--klippy/stepcompress.c3
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;