lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 73d5f2b 06/14: Refactor for terseness


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 73d5f2b 06/14: Refactor for terseness
Date: Sun, 6 Sep 2020 07:50:37 -0400 (EDT)

branch: master
commit 73d5f2bbf52636102155bffe4f97b1c5a756f4f7
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Refactor for terseness
---
 ihs_acctval.cpp | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 0b7d76c..f090ddc 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -1590,32 +1590,20 @@ double AccountValue::ApportionNetMortalityReserve
     return apportioned_reserve * yare_input_.NumberOfIdenticalLives;
 }
 
-//============================================================================
+/// Beginning of year inforce lives, reflecting lapses and survivorship.
+
 double AccountValue::InforceLivesBoy() const
 {
-    if
-        (   ItLapsed
-        ||  BasicValues::GetLength() <= Year
-        )
-        {
-        return 0.0;
-        }
-
-    return partial_mortality_lx.at(Year);
+    bool const b {ItLapsed || BasicValues::GetLength() <= Year};
+    return b ? 0.0 : partial_mortality_lx.at(Year);
 }
 
-//============================================================================
+/// End of year inforce lives, reflecting lapses and survivorship.
+
 double AccountValue::InforceLivesEoy() const
 {
-    if
-        (   ItLapsed
-        ||  BasicValues::GetLength() <= Year
-        )
-        {
-        return 0.0;
-        }
-
-    return partial_mortality_lx.at(1 + Year);
+    bool const b {ItLapsed || BasicValues::GetLength() <= Year};
+    return b ? 0.0 : partial_mortality_lx.at(1 + Year);
 }
 
 //============================================================================



reply via email to

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