[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master b5effd2 2/5: Prefer arguments to members copi
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master b5effd2 2/5: Prefer arguments to members copied therefrom in ctor |
Date: |
Fri, 3 Feb 2017 20:07:36 +0000 (UTC) |
branch: master
commit b5effd2293e2b92277bc07ef4363c9ed17d0b588
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Prefer arguments to members copied therefrom in ctor
Changed a ctor to use its arguments (in const situations) rather than
the copies created in its ctor-initializer, particularly because those
copies are mostly unused otherwise and may someday be removed.
---
input_sequence.cpp | 16 ++++++++--------
input_sequence.hpp | 2 ++
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/input_sequence.cpp b/input_sequence.cpp
index 5d333cc..20c55cf 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -108,13 +108,13 @@ InputSequence::InputSequence
{
SequenceParser parser
(input_expression
- ,years_to_maturity_
- ,issue_age_
- ,retirement_age_
- ,inforce_duration_
- ,effective_year_
- ,allowed_keywords_
- ,keywords_only_
+ ,a_years_to_maturity
+ ,a_issue_age
+ ,a_retirement_age
+ ,a_inforce_duration
+ ,a_effective_year
+ ,a_allowed_keywords
+ ,a_keywords_only
);
parser_diagnostics_ = parser.diagnostics();
@@ -137,7 +137,7 @@ InputSequence::InputSequence
// This invariant has not yet been established, whether or not the
// sequence was empty.
- intervals_.back().end_duration = years_to_maturity_;
+ intervals_.back().end_duration = a_years_to_maturity;
// This invariant is established by realize_vector(), but it does
// no harm to repeat it here, and it would be confusing not to do
// so in conjunction with the line above.
diff --git a/input_sequence.hpp b/input_sequence.hpp
index c754517..b4dfe6c 100644
--- a/input_sequence.hpp
+++ b/input_sequence.hpp
@@ -289,6 +289,8 @@ class LMI_SO InputSequence
void realize_vector();
// Copies of ctor args that are identical to class SequenceParser's.
+ // Most of these copies are unused as this is written in 2017-01;
+ // they're retained in case a use is someday found for them.
int years_to_maturity_;
int issue_age_;
int retirement_age_;