lmi-commits
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]