message (_ ("Finding the ideal number of pages..."));
set_to_ideal_line_configuration (0, end);
- Line_division ideal_line_division = current_configuration (0);
Page_spacing_result best = space_systems_on_best_pages (0, first_page_num);
vsize page_count = best.systems_per_page_.size ();
+ Line_division ideal_line_division = current_configuration (0);
Line_division best_division = ideal_line_division;
vsize ideal_sys_count = best.system_count ();
best_division = bound;
}
- if (best_for_this_sys_count.systems_per_page_.size () < page_count)
- {
- /* if the pages are stretched on average, stop trying to reduce sys_count */
- Real avg_f = 0;
- for (vsize i = 0; i < best_for_this_sys_count.systems_per_page_.size (); i++)
- avg_f += best_for_this_sys_count.systems_per_page_[i];
- if (avg_f > 0)
- break;
- }
+ /* if the pages are stretched on average, stop trying to reduce sys_count */
+ if (best_for_this_sys_count.page_count () < page_count
+ && best_for_this_sys_count.average_force () > 0)
+ break;
+
if (isinf (best_for_this_sys_count.demerits_))
break;