[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master e8c4054 04/10: Localize a data member
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master e8c4054 04/10: Localize a data member |
Date: |
Fri, 4 Sep 2020 21:16:09 -0400 (EDT) |
branch: master
commit e8c4054f9c15fb9526304c3aa34b83dcca763e1d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Localize a data member
AccountValue::YearsSpecAmt was assigned at the start of each year, and
then used in only one member function. Moved the assignment into that
member function, making it a (const) local variable.
---
account_value.hpp | 1 -
accountvalue.cpp | 1 -
ihs_acctval.cpp | 2 --
ihs_avmly.cpp | 1 +
4 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/account_value.hpp b/account_value.hpp
index 3ec5a12..fb24786 100644
--- a/account_value.hpp
+++ b/account_value.hpp
@@ -475,7 +475,6 @@ class LMI_SO AccountValue final
// annual invariants.
double YearsCorridorFactor;
mcenum_dbopt YearsDBOpt;
- double YearsSpecAmt;
double YearsAnnualPolicyFee;
double YearsMonthlyPolicyFee;
double YearsGenAcctIntRate;
diff --git a/accountvalue.cpp b/accountvalue.cpp
index abdb9b9..43f6873 100644
--- a/accountvalue.cpp
+++ b/accountvalue.cpp
@@ -298,7 +298,6 @@ void AccountValue::DoYear
,mce_monthly_rate
)[Year]
);
- YearsSpecAmt = DeathBfts_->specamt()[Year];
YearsDBOpt = DeathBfts_->dbopt()[Year];
// For guaranteed-basis run, what loan rates should be used?
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index e8be4cf..aeef35d 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -866,8 +866,6 @@ void AccountValue::InitializeYear()
//============================================================================
void AccountValue::InitializeSpecAmt()
{
- YearsSpecAmt = DeathBfts_->specamt()[Year];
-
// TODO ?? These variables are set in current run and used in guar and
midpt.
ActualSpecAmt = InvariantValues().SpecAmt[Year];
TermSpecAmt = InvariantValues().TermSpecAmt[Year];
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 4a6ed18..6c65ba4 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -989,6 +989,7 @@ void AccountValue::TxSpecAmtChange()
ChangeSupplAmtBy(DeathBfts_->supplamt()[Year] - TermSpecAmt);
}
+ double const YearsSpecAmt = DeathBfts_->specamt()[Year];
double const old_specamt = DeathBfts_->specamt()[Year - 1];
// Nothing to do if no increase or decrease requested.
- [lmi-commits] [lmi] master updated (520bb97 -> c4f84b4), Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master f2e2cd7 01/10: Refactor to do less work, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 9878b92 02/10: Refactor, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 8fa4ca4 03/10: Reformat and append to commentary, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 4f10238 05/10: Rename a local variable, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 42f390d 06/10: Improve documentation, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master e8c4054 04/10: Localize a data member,
Greg Chicares <=
- [lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marked defect, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 6a54fd9 09/10: Never read 7702 or 7702A specamt directly from LedgerInvariant, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master f474d10 08/10: Prepare to abstract specified amount, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master c4f84b4 10/10: Never read specamt directly from LedgerInvariant, Greg Chicares, 2020/09/04