stepcompress: Prefer greater interval if all else equal

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor committed 2016-12-19 11:20:39 -05:00
1 parent 19d1f83d97
commit 1d841eeb87
1 file changed
+2 -1
+2 -1
View File
@@ -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;