From adbb05950fbabefd3f1712ce6db759f826e4100d Mon Sep 17 00:00:00 2001 From: Katie Mummah Date: Mon, 30 Sep 2024 08:39:17 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Paul Wilson Signed-off-by: Katie Mummah --- src/package.cc | 4 ++-- src/package.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/package.cc b/src/package.cc index f3f6a6e6a4..6cae23fbe0 100644 --- a/src/package.cc +++ b/src/package.cc @@ -81,14 +81,14 @@ std::vector Package::GetFillMass(double qty) { if (strategy_ == "uniform" || strategy_ == "normal") { // only use random if a full package amount is available. if less than one // full amount is available, below will fill a partial package (no random). - while ((qty > 0) && (qty >= fill_max_)) { + while ( qty > std::max(0,fill_max_) ) { fill_mass = dist_->sample(); packages.push_back(fill_mass); qty -= fill_mass; } } - if (qty > eps_rsrc() && qty >= fill_min_) { + if (qty > std::max(eps_rsrc(),fill_min_) ) { // leftover material is enough to fill one more partial package. packages.push_back(qty); } diff --git a/src/package.h b/src/package.h index eb90920923..9b75203ab7 100644 --- a/src/package.h +++ b/src/package.h @@ -9,7 +9,8 @@ #include "error.h" #include "logger.h" -#include "random_number_generator.h" +class DoubleDistribution; +class DoubleDistribution::Ptr; namespace cyclus {