From 07a972a10e09e91d1553b0eb5ed39cd7e9409fff Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Thu, 4 Jan 2024 10:35:14 +0100 Subject: [PATCH] std::set can be initialized directly --- ql/time/calendars/china.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ql/time/calendars/china.cpp b/ql/time/calendars/china.cpp index 6de2a69ade6..30ff5bab390 100644 --- a/ql/time/calendars/china.cpp +++ b/ql/time/calendars/china.cpp @@ -201,7 +201,7 @@ namespace QuantLib { } bool China::IbImpl::isBusinessDay(const Date& date) const { - static const Date working_weekends[] = { + static const std::set workingWeekends = { // 2005 Date(5, February, 2005), Date(6, February, 2005), @@ -356,9 +356,6 @@ namespace QuantLib { Date(29, Sep, 2024), Date(12, October, 2024) }; - static const Size n = sizeof(working_weekends) / sizeof(working_weekends[0]); - static const std::set workingWeekends(working_weekends+0, - working_weekends+n); // If it is already a SSE business day, it must be a IB business day return sseImpl->isBusinessDay(date) ||