lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master dfb045a 8/8: Move a block of code


From: Greg Chicares
Subject: [lmi-commits] [lmi] master dfb045a 8/8: Move a block of code
Date: Thu, 9 Apr 2020 18:33:05 -0400 (EDT)

branch: master
commit dfb045a64962fefd0dbc103d0fe63c66861cfebe
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Move a block of code
    
    Moved the block that treats CorridorFactor as a special case to follow
    immediately after the call to the base class's PlusEq().
---
 ledger_invariant.cpp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index 51f3866..658cd7d 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -493,6 +493,17 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant 
const& a_Addend)
 {
     LedgerBase::PlusEq(a_Addend, a_Addend.InforceLives);
 
+    // For 'CorridorFactor', an average weighted by number of lives
+    // would be inaccurate, and indeed any aggregate value could be
+    // surprising because it would not necessarily be monotone (for
+    // two lives with a ten-year age difference, the last ten would
+    // depend on the younger life only, most likely producing a
+    // discontinuity at the older life's maturity age).
+    for(int j = 0; j < a_Addend.Length; ++j)
+        {
+        CorridorFactor       [j] = 0.0;
+        }
+
     irr_precision_ = a_Addend.irr_precision_;
 
     std::vector<double> const& N = a_Addend.InforceLives;
@@ -766,17 +777,6 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant 
const& a_Addend)
     SmokerDistinct                = a_Addend.SmokerDistinct;
     SmokerBlended                 = a_Addend.SmokerBlended;
 
-    // For 'CorridorFactor', an average weighted by number of lives
-    // would be inaccurate, and indeed any aggregate value could be
-    // surprising because it would not necessarily be monotone (for
-    // two lives with a ten-year age difference, the last ten would
-    // depend on the younger life only, most likely producing a
-    // discontinuity at the older life's maturity age).
-    for(int j = 0; j < a_Addend.Length; ++j)
-        {
-        CorridorFactor       [j] = 0.0;
-        }
-
     IsMec                         = a_Addend.IsMec        || IsMec;
     InforceIsMec                  = a_Addend.InforceIsMec || InforceIsMec;
 



reply via email to

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