Skip to content

Commit

Permalink
Unrelated but replace a C-array of std::string with an array
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Dec 12, 2024
1 parent 35964ba commit 9bdb2b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/EnergyPlus/CurveManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@

// C++ Headers
#include <algorithm>
#include <array>
#include <cmath>
#include <limits>
#include <string>
#include <string_view>

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
Expand Down Expand Up @@ -1480,7 +1482,7 @@ namespace Curve {
}

constexpr int NumVar = 4;
std::string VarNames[NumVar] = {"w", "x", "y", "z"};
constexpr std::array<std::string_view, NumVar> VarNames{"w", "x", "y", "z"};
for (int i = 1; i <= NumVar; ++i) {
int MinIndex = 2 * i + 4;
int MaxIndex = MinIndex + 1;
Expand Down Expand Up @@ -1560,7 +1562,7 @@ namespace Curve {
}

constexpr int NumVar = 5;
std::string VarNames[NumVar] = {"v", "w", "x", "y", "z"};
constexpr std::array<std::string_view, NumVar> VarNames{"v", "w", "x", "y", "z"};
for (int i = 1; i <= NumVar; ++i) {
int MinIndex = 2 * i + 5;
int MaxIndex = MinIndex + 1;
Expand Down

3 comments on commit 9bdb2b7

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10830_Incorrect_CurveUnitTypeWarning (jmarrec) - x86_64-Linux-Ubuntu-24.04-gcc-13.2: OK (2921 of 2921 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10830_Incorrect_CurveUnitTypeWarning (jmarrec) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-UnitTestsCoverage-RelWithDebInfo: OK (2103 of 2103 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10830_Incorrect_CurveUnitTypeWarning (jmarrec) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-IntegrationCoverage-RelWithDebInfo: OK (801 of 801 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.