Skip to content

Commit 2acf1bc

Browse files
andiwandclaude
andcommitted
PDF: const-qualify scalar by-value constructor params
Add top-level const to the cheap scalar by-value parameters `n` (ExponentialFunction) and `bits_per_sample` (SampledFunction), matching the codebase convention of const-qualifying scalar params in definitions. Object/vector params stay non-const because they are std::move'd into members, so adding const would defeat the move. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uqx1dUpDUykRxui8FYwxvM
1 parent 500327d commit 2acf1bc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/odr/internal/pdf/pdf_function.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ double interpolate(const double x, const double a0, const double a1,
4646
class ExponentialFunction final : public Function {
4747
public:
4848
ExponentialFunction(std::vector<double> domain, std::vector<double> range,
49-
std::vector<double> c0, std::vector<double> c1, double n)
49+
std::vector<double> c0, std::vector<double> c1,
50+
const double n)
5051
: Function(std::move(domain), std::move(range)), m_c0{std::move(c0)},
5152
m_c1{std::move(c1)}, m_n{n} {}
5253

@@ -115,7 +116,8 @@ class StitchingFunction final : public Function {
115116
class SampledFunction final : public Function {
116117
public:
117118
SampledFunction(std::vector<double> domain, std::vector<double> range,
118-
std::vector<std::size_t> size, std::int32_t bits_per_sample,
119+
std::vector<std::size_t> size,
120+
const std::int32_t bits_per_sample,
119121
std::vector<double> encode, std::vector<double> decode,
120122
std::string samples)
121123
: Function(std::move(domain), std::move(range)), m_size{std::move(size)},

0 commit comments

Comments
 (0)