File tree Expand file tree Collapse file tree
src/simulation/investment Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -365,9 +365,10 @@ fn compare_asset_fallback(asset1: &Asset, asset2: &Asset) -> Ordering {
365365/// are preferred over uncommissioned assets, and newer assets are preferred over older
366366/// ones. The function does not guarantee that all ties will be resolved.
367367///
368- /// Assets with zero capacity are filtered out before sorting,
369- /// as their metric would be `NaN` and could cause the program to panic. So the length
370- /// of the returned vector may be less than the input.
368+ /// Before sorting, outputs are filtered using [`AppraisalOutput::is_valid`], which
369+ /// excludes entries with invalid metrics (e.g. `None`) as well as zero capacity. This
370+ /// avoids meaningless or `NaN` appraisal metrics that could cause the program to panic,
371+ /// so the length of the returned vector may be less than the input.
371372pub fn sort_appraisal_outputs_by_investment_priority ( outputs_for_opts : & mut Vec < AppraisalOutput > ) {
372373 outputs_for_opts. retain ( AppraisalOutput :: is_valid) ;
373374 outputs_for_opts. sort_by ( |output1, output2| match output1. compare_metric ( output2) {
You can’t perform that action at this time.
0 commit comments