Skip to content

Commit

Permalink
Implicit conversion code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaredstork committed Sep 22, 2023
1 parent c63db75 commit be0b0c9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,21 @@ void ApplyRandomTSnumbers(const Study& study,
ptchro.Solar
= (data.timeSeries.width != 1) ? (long)data.timeseriesNumbers[0][year] : 0; // zero-based
}
// Hydro and Hydro Max Power
// Hydro
{
const Data::DataSeriesHydro& data = *area.hydro.series;
assert(year < data.timeseriesNumbers.height);
assert(year < data.timeseriesNumbersHydroMaxPower.height);

ptchro.Hydraulique
= (data.count != 1) ? (long)data.timeseriesNumbers[0][year] : 0; // zero-based
ptchro.HydrauliqueMaxPower
= (data.countpowercredits != 1)
? static_cast<long>(data.timeseriesNumbersHydroMaxPower[0][year])
: 0;
}
// Hydro Max Power
{
const Data::DataSeriesHydro& data = *area.hydro.series;
assert(year < data.timeseriesNumbersHydroMaxPower.height);
ptchro.HydrauliqueMaxPower = (data.countpowercredits != 1)
? (data.timeseriesNumbersHydroMaxPower[0][year])
: 0; // zero-based
}
// Wind
{
Expand Down

0 comments on commit be0b0c9

Please sign in to comment.