[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master fbf14ae 3/5: Refactor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master fbf14ae 3/5: Refactor |
Date: |
Thu, 27 Aug 2020 14:42:48 -0400 (EDT) |
branch: master
commit fbf14aee5cb6b63438f6f839132d2b46caafc634
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Refactor
Replaced
InvariantValues().DBOpt[N].value()
(which reads a vector element of this type:
typedef mc_enum<mcenum_dbopt> mce_dbopt
and then calls value() to get a value of type mcenum_dbopt) with
DeathBfts_->dbopt()[N]
(which reads an element of type mcenum_dbopt). That's less complicated,
and avoids treating the ledger object as a write-mostly-read-sometimes
cache.
---
ihs_acctval.cpp | 4 ++--
solve.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 5b8bbba..b13b627 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -424,7 +424,7 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
VariantValues().Init(*this, GenBasis_, SepBasis_);
InvariantValues().Init(this);
- OldDBOpt = InvariantValues().DBOpt[0].value();
+ OldDBOpt = DeathBfts_->dbopt()[0];
// TAXATION !! 'OldSA' and 'OldDB' need to be distinguished for 7702 and
7702A,
// with inclusion of term dependent on 'TermIsDbFor7702' and
'TermIsDbFor7702A'.
OldSA = InvariantValues().SpecAmt[0] + InvariantValues().TermSpecAmt[0];
@@ -448,7 +448,7 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
Irc7702_->Initialize7702
(sa
,sa
- ,effective_dbopt_7702(InvariantValues().DBOpt[0].value(),
Effective7702DboRop)
+ ,effective_dbopt_7702(DeathBfts_->dbopt()[0], Effective7702DboRop)
,annual_target_premium
);
diff --git a/solve.cpp b/solve.cpp
index 8b27ee1..b553bf4 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -105,7 +105,7 @@ double SolveTest()
{
// We take endowment to mean for spec amt, so it's the
// same for options A and B.
- switch(ConstThat->InvariantValues().DBOpt[ThatSolveTgtYear -
1].value())
+ switch(ConstThat->DeathBfts_->dbopt()[ThatSolveTgtYear - 1])
{
case mce_option1:
{