lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a useless one
Date: Thu, 4 Oct 2018 19:24:15 -0400 (EDT)

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

    Store a useful value; discard a useless one
    
    'MaxDuration' is used only for XSL-FO; discarded it elsewhere.
    
    'GreatestLapseDuration' is actually useful; stored it for the new PDF
    implementation, which will soon make use of it.
    
    Expunged misleading comments that suggested GetMaxLength() is the
    "max *composite* length". Actually it is the greatest lapse duration
    across all {current, guaranteed, etc.} bases: thus, the number of rows
    to be printed on an illustration; it has nothing to do with a composite
    that summarizes multiple lives in a group.
---
 ledger_evaluator.cpp | 11 +++++------
 ledger_xml_io.cpp    |  2 --
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index cb90029..8db69b3 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -502,6 +502,7 @@ ledger_evaluator Ledger::make_evaluator() const
     format_map["External1035Amount"                ] = f1;
     format_map["GenderBlended"                     ] = f1;
     format_map["GenderDistinct"                    ] = f1;
+    format_map["GreatestLapseDuration"             ] = f1;
     format_map["Has1035ExchCharge"                 ] = f1;
     format_map["HasADD"                            ] = f1;
     format_map["HasChildRider"                     ] = f1;
@@ -521,7 +522,6 @@ ledger_evaluator Ledger::make_evaluator() const
     format_map["IsMec"                             ] = f1;
     format_map["LapseMonth"                        ] = f1;
     format_map["LapseYear"                         ] = f1;
-    format_map["MaxDuration"                       ] = f1;
     format_map["MecMonth"                          ] = f1;
     format_map["MecYear"                           ] = f1;
     format_map["NoLapse"                           ] = f1;
@@ -694,11 +694,10 @@ ledger_evaluator Ledger::make_evaluator() const
     vectors["IrrCsv_Current"        ] = &ledger_invariant_->IrrCsvCurrInput;
     vectors["IrrDb_Current"         ] = &ledger_invariant_->IrrDbCurrInput ;
 
-// GetMaxLength() is max *composite* length.
-//    int max_length = GetMaxLength();
-    double MaxDuration = ledger_invariant_->EndtAge - ledger_invariant_->Age;
-    scalars["MaxDuration"] = &MaxDuration;
-    int max_duration = static_cast<int>(MaxDuration);
+    double GreatestLapseDuration = GetMaxLength();
+    scalars["GreatestLapseDuration"] = &GreatestLapseDuration;
+
+    int max_duration = static_cast<int>(ledger_invariant_->EndtAge - 
ledger_invariant_->Age);
     int issue_age = static_cast<int>(ledger_invariant_->Age);
 
     std::vector<double> AttainedAge(max_duration);
diff --git a/ledger_xml_io.cpp b/ledger_xml_io.cpp
index d75231e..b5b6f08 100644
--- a/ledger_xml_io.cpp
+++ b/ledger_xml_io.cpp
@@ -573,8 +573,6 @@ void Ledger::write(xml::element& x) const
     vectors["IrrCsv_Current"        ] = &ledger_invariant_->IrrCsvCurrInput;
     vectors["IrrDb_Current"         ] = &ledger_invariant_->IrrDbCurrInput ;
 
-// GetMaxLength() is max *composite* length.
-//    int max_length = GetMaxLength();
     double MaxDuration = ledger_invariant_->EndtAge - ledger_invariant_->Age;
     scalars["MaxDuration"] = &MaxDuration;
     int max_duration = static_cast<int>(MaxDuration);



reply via email to

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