mirror of https://github.com/Desuuuu/klipper.git
stepcompress: Prefer greater interval if all else equal
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
19d1f83d97
commit
1d841eeb87
|
@ -164,7 +164,8 @@ compress_bisect_add(struct stepcompress *sc)
|
||||||
// Check if this is the best sequence found so far
|
// Check if this is the best sequence found so far
|
||||||
int32_t count = nextcount - 1, addfactor = count*(count-1)/2;
|
int32_t count = nextcount - 1, addfactor = count*(count-1)/2;
|
||||||
int32_t reach = add*addfactor + interval*count;
|
int32_t reach = add*addfactor + interval*count;
|
||||||
if (reach > bestreach) {
|
if (reach > bestreach
|
||||||
|
|| (reach == bestreach && interval > bestinterval)) {
|
||||||
bestinterval = interval;
|
bestinterval = interval;
|
||||||
bestcount = count;
|
bestcount = count;
|
||||||
bestadd = add;
|
bestadd = add;
|
||||||
|
|
Loading…
Reference in New Issue