From 9ba63d443bbaac3057fd6d199bd99be1a1d7c150 Mon Sep 17 00:00:00 2001 From: Mathias Soeken Date: Mon, 27 Jan 2025 11:18:36 +0100 Subject: [PATCH] Fixes possible infinite loop. --- .../physical_estimation/estimate_without_restrictions.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resource_estimator/src/estimates/physical_estimation/estimate_without_restrictions.rs b/resource_estimator/src/estimates/physical_estimation/estimate_without_restrictions.rs index 60fefe17d3..b23be237ba 100644 --- a/resource_estimator/src/estimates/physical_estimation/estimate_without_restrictions.rs +++ b/resource_estimator/src/estimates/physical_estimation/estimate_without_restrictions.rs @@ -107,7 +107,10 @@ impl< )); } - num_cycles = max_allowed_num_cycles_for_code_parameter + 1; + num_cycles = std::cmp::max( + max_allowed_num_cycles_for_code_parameter + 1, + num_cycles + 1, + ); } }