diff --git a/src/compiler/crystal/compiler.cr b/src/compiler/crystal/compiler.cr index 1d540e02f2e9..b30b184e1023 100644 --- a/src/compiler/crystal/compiler.cr +++ b/src/compiler/crystal/compiler.cr @@ -505,8 +505,6 @@ module Crystal private def codegen_many_units(program, units, target_triple) all_reused = [] of String - wants_stats_or_progress = @progress_tracker.stats? || @progress_tracker.progress? - # Don't start more processes than compilation units n_threads = @n_threads.clamp(1..units.size) @@ -516,7 +514,12 @@ module Crystal if n_threads == 1 units.each do |unit| unit.compile - all_reused << unit.name if wants_stats_or_progress && unit.reused_previous_compilation? + @progress_tracker.stage_progress += 1 + end + if @progress_tracker.stats? + units.each do |unit| + all_reused << unit.name && unit.reused_previous_compilation? + end end return all_reused end @@ -597,10 +600,10 @@ module Crystal exit 1 end - if wants_stats_or_progress + if @progress_tracker.stats? all_reused << result["name"].as_s if result["reused"].as_bool - @progress_tracker.stage_progress += 1 end + @progress_tracker.stage_progress += 1 end all_reused