Skip to content

Commit b41dcfb

Browse files
lballabio-botlballabio
authored andcommitted
Automated fixes by clang-tidy
1 parent 1c3d908 commit b41dcfb

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

ql/instruments/makecds.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <ql/instruments/makecds.hpp>
2222
#include <ql/time/daycounters/actual360.hpp>
2323
#include <ql/time/calendars/weekendsonly.hpp>
24+
#include <utility>
2425

2526

2627
namespace QuantLib {
@@ -153,7 +154,7 @@ namespace QuantLib {
153154
}
154155

155156
MakeCreditDefaultSwap& MakeCreditDefaultSwap::withClaim(ext::shared_ptr<Claim> claim) {
156-
claim_ = claim;
157+
claim_ = std::move(claim);
157158
return *this;
158159
}
159160

ql/instruments/multipleresetsswap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace QuantLib {
3737

3838
MultipleResetsSwap::MultipleResetsSwap(
3939
Type type, Real nominal,
40-
Schedule fixedSchedule, Rate fixedRate, DayCounter fixedDayCount,
40+
const Schedule& fixedSchedule, Rate fixedRate, DayCounter fixedDayCount,
4141
Schedule fullResetSchedule,
4242
const ext::shared_ptr<IborIndex>& iborIndex, Size resetsPerCoupon,
4343
Spread spread, RateAveraging::Type averagingMethod,

ql/instruments/multipleresetsswap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace QuantLib {
4141
public:
4242
MultipleResetsSwap(Type type,
4343
Real nominal,
44-
Schedule fixedSchedule,
44+
const Schedule& fixedSchedule,
4545
Rate fixedRate,
4646
DayCounter fixedDayCount,
4747
Schedule fullResetSchedule,

ql/termstructures/volatility/equityfx/blackvolsurfacedelta.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace QuantLib {
113113
//@}
114114
//! \name Visitability
115115
//@{
116-
virtual void accept(AcyclicVisitor&) override;
116+
void accept(AcyclicVisitor&) override;
117117
//@}
118118

119119
//! \name Inspectors
@@ -159,7 +159,7 @@ namespace QuantLib {
159159
ext::shared_ptr<SmileSection> blackVolSmile(const Date& d) const;
160160

161161
protected:
162-
virtual Volatility blackVolImpl(Time t, Real strike) const override;
162+
Volatility blackVolImpl(Time t, Real strike) const override;
163163

164164
private:
165165
std::vector<Date> dates_;
@@ -195,8 +195,8 @@ namespace QuantLib {
195195
// inline definitions
196196

197197
inline void BlackVolatilitySurfaceDelta::accept(AcyclicVisitor& v) {
198-
Visitor<BlackVolatilitySurfaceDelta>* v1 = dynamic_cast<Visitor<BlackVolatilitySurfaceDelta>*>(&v);
199-
if (v1 != 0)
198+
auto* v1 = dynamic_cast<Visitor<BlackVolatilitySurfaceDelta>*>(&v);
199+
if (v1 != nullptr)
200200
v1->visit(*this);
201201
else
202202
BlackVolatilityTermStructure::accept(v);

ql/termstructures/yield/multipleresetsswaphelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ namespace QuantLib {
3434
RateAveraging::Type averagingMethod,
3535
Spread spread,
3636
Frequency fixedFrequency,
37-
DayCounter fixedDayCount,
37+
const DayCounter& fixedDayCount,
3838
BusinessDayConvention fixedConvention)
3939
: RelativeDateRateHelper(fixedRate), settlementDays_(settlementDays), tenor_(tenor),
4040
resetsPerCoupon_(resetsPerCoupon), averagingMethod_(averagingMethod), spread_(spread),
4141
fixedFrequency_(fixedFrequency),
42-
fixedDayCount_(!fixedDayCount.empty() ? std::move(fixedDayCount) : iborIndex->dayCounter()),
42+
fixedDayCount_(!fixedDayCount.empty() ? fixedDayCount : iborIndex->dayCounter()),
4343
fixedConvention_(fixedConvention), discountHandle_(std::move(discountingCurve)) {
4444

4545
// Clone the index so it forwards rates from termStructureHandle_,

ql/termstructures/yield/multipleresetsswaphelper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace QuantLib {
4545
RateAveraging::Type averagingMethod = RateAveraging::Compound,
4646
Spread spread = 0.0,
4747
Frequency fixedFrequency = NoFrequency,
48-
DayCounter fixedDayCount = DayCounter(),
48+
const DayCounter& fixedDayCount = DayCounter(),
4949
BusinessDayConvention fixedConvention = ModifiedFollowing);
5050

5151
Real impliedQuote() const override;

test-suite/interpolatedsmilesection.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ BOOST_AUTO_TEST_CASE(testHandlesUpdatePropagates) {
118118
ext::shared_ptr<SimpleQuote> q1(new SimpleQuote(0.15 * sqrtT));
119119
ext::shared_ptr<SimpleQuote> q2(new SimpleQuote(0.18 * sqrtT));
120120
std::vector<Handle<Quote>> stdDevHandles;
121-
stdDevHandles.emplace_back(Handle<Quote>(q0));
122-
stdDevHandles.emplace_back(Handle<Quote>(q1));
123-
stdDevHandles.emplace_back(Handle<Quote>(q2));
121+
stdDevHandles.emplace_back(q0);
122+
stdDevHandles.emplace_back(q1);
123+
stdDevHandles.emplace_back(q2);
124124

125125
ext::shared_ptr<SimpleQuote> atm(new SimpleQuote(95.0));
126126
Handle<Quote> atmHandle(atm);
@@ -158,9 +158,9 @@ BOOST_AUTO_TEST_CASE(testFlatStrikeExtrapolation) {
158158
ext::shared_ptr<SimpleQuote> q1(new SimpleQuote(0.15 * sqrtT));
159159
ext::shared_ptr<SimpleQuote> q2(new SimpleQuote(0.18 * sqrtT));
160160
std::vector<Handle<Quote>> stdDevHandles;
161-
stdDevHandles.emplace_back(Handle<Quote>(q0));
162-
stdDevHandles.emplace_back(Handle<Quote>(q1));
163-
stdDevHandles.emplace_back(Handle<Quote>(q2));
161+
stdDevHandles.emplace_back(q0);
162+
stdDevHandles.emplace_back(q1);
163+
stdDevHandles.emplace_back(q2);
164164

165165
ext::shared_ptr<SimpleQuote> atm(new SimpleQuote(95.0));
166166
Handle<Quote> atmHandle(atm);

0 commit comments

Comments
 (0)