Skip to content

Commit 9f8c5bb

Browse files
committed
cleanup: unify code (call boost::to_upper_copy)
1 parent 1e607e3 commit 9f8c5bb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ql/time/ecb.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ namespace QuantLib {
151151
QL_REQUIRE(isECBcode(ecbCode),
152152
ecbCode << " is not a valid ECB code");
153153

154-
std::array<char, 3> upperMonthCode;
155-
for (int i=0; i<3; ++i)
156-
upperMonthCode[i] = std::toupper(ecbCode[i]);
157-
const boost::string_view monthString(upperMonthCode.data(), 3);
154+
char upperMonthCode[3];
155+
to_upper_copy(upperMonthCode, ecbCode);
156+
const boost::string_view monthString(upperMonthCode, 3);
158157
const auto it = std::find(MONTHS.begin(), MONTHS.end(), monthString);
159158
QL_ASSERT(it != MONTHS.end() ,"not an ECB month (and it should have been). code: " + ecbCode);
160159

0 commit comments

Comments
 (0)