diff --git a/ql/experimental/termstructures/crosscurrencyratehelpers.cpp b/ql/experimental/termstructures/crosscurrencyratehelpers.cpp index d93c1d0e30..85f307f099 100644 --- a/ql/experimental/termstructures/crosscurrencyratehelpers.cpp +++ b/ql/experimental/termstructures/crosscurrencyratehelpers.cpp @@ -95,7 +95,7 @@ namespace QuantLib { const DayCounter& dayCount, Integer paymentLag) { - Period freqPeriod = Period(paymentFrequency); + auto freqPeriod = Period(paymentFrequency); Schedule sch = legSchedule(evaluationDate, tenor, freqPeriod, fixingDays, calendar, convention, endOfMonth); @@ -277,7 +277,7 @@ namespace QuantLib { bool isBasisOnFxBaseCurrencyLeg, Frequency paymentFrequency, Integer paymentLag) - : CrossCurrencySwapRateHelperBase(basis, tenor, fixingDays, calendar, convention, endOfMonth, + : CrossCurrencySwapRateHelperBase(basis, tenor, fixingDays, std::move(calendar), convention, endOfMonth, std::move(collateralCurve), paymentLag), baseCcyIdx_(std::move(baseCurrencyIndex)), quoteCcyIdx_(std::move(quoteCurrencyIndex)), isFxBaseCurrencyCollateralCurrency_(isFxBaseCurrencyCollateralCurrency), @@ -432,15 +432,15 @@ namespace QuantLib { BusinessDayConvention convention, bool endOfMonth, Frequency fixedFrequency, - const DayCounter& fixedDayCount, + DayCounter fixedDayCount, const ext::shared_ptr& floatIndex, const Handle& collateralCurve, bool collateralOnFixedLeg, Integer paymentLag) : CrossCurrencySwapRateHelperBase(fixedRate, tenor, fixingDays, calendar, convention, endOfMonth, - std::move(collateralCurve), paymentLag), + collateralCurve, paymentLag), fixedFrequency_(fixedFrequency), - fixedDayCount_(fixedDayCount), + fixedDayCount_(std::move(fixedDayCount)), floatIndex_(floatIndex), collateralOnFixedLeg_(collateralOnFixedLeg) { diff --git a/ql/experimental/termstructures/crosscurrencyratehelpers.hpp b/ql/experimental/termstructures/crosscurrencyratehelpers.hpp index fb7d0e652c..64e72e5eee 100644 --- a/ql/experimental/termstructures/crosscurrencyratehelpers.hpp +++ b/ql/experimental/termstructures/crosscurrencyratehelpers.hpp @@ -203,7 +203,7 @@ namespace QuantLib { BusinessDayConvention convention, bool endOfMonth, Frequency fixedFrequency, - const DayCounter& fixedDayCount, + DayCounter fixedDayCount, const ext::shared_ptr& floatIndex, const Handle& collateralCurve, bool collateralOnFixedLeg, diff --git a/test-suite/crosscurrencyratehelpers.cpp b/test-suite/crosscurrencyratehelpers.cpp index e83df36538..d1c9c86deb 100644 --- a/test-suite/crosscurrencyratehelpers.cpp +++ b/test-suite/crosscurrencyratehelpers.cpp @@ -585,7 +585,8 @@ BOOST_AUTO_TEST_CASE(testConstNotionalHelperCollateralOnFixedLeg) { }; std::vector > helpers; - for (auto [tenor, q]: quotes) { + helpers.reserve(quotes.size()); +for (auto [tenor, q]: quotes) { helpers.push_back(ext::make_shared( makeQuoteHandle(q), tenor, fixingDays, cal, bdc, endOfMonth, fixedFreq, fixedDC, euribor3m, @@ -682,7 +683,8 @@ BOOST_AUTO_TEST_CASE(testConstNotionalHelperCollateralOnFloatingLeg) { }; std::vector > helpers; - for (auto [tenor, q]: quotes) { + helpers.reserve(quotes.size()); +for (auto [tenor, q]: quotes) { helpers.push_back(ext::make_shared( makeQuoteHandle(q), tenor, fixingDays, cal, bdc, endOfMonth, fixedFreq, fixedDC, euribor3m,