[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master af5a41d 2/9: Demonstrate the nugatoriness of
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master af5a41d 2/9: Demonstrate the nugatoriness of composite_lapse_year_ |
Date: |
Thu, 4 Oct 2018 19:24:14 -0400 (EDT) |
branch: master
commit af5a41dfe448bdce6a29be52eb429730760f7398
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Demonstrate the nugatoriness of composite_lapse_year_
Running a census with various ages, this momentaneous change's assertion
was observed never to fail; therefore, this data member is confirmed to
be a bogus optimization that can be dispensed with.
---
ledger.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ledger.cpp b/ledger.cpp
index 4fc57c9..c7d9db2 100644
--- a/ledger.cpp
+++ b/ledger.cpp
@@ -289,6 +289,14 @@ int Ledger::GetMaxLength() const
{
if(is_composite_)
{
+ ledger_map_t const& l_map_rep = ledger_map_->held();
+ double max_length = 0.0;
+
+ for(auto const& i : l_map_rep)
+ {
+ max_length = std::max(max_length, i.second.LapseYear);
+ }
+ LMI_ASSERT(max_length == composite_lapse_year_);
// TODO ?? The rationale for this special case is not evident.
// This variable is initialized to zero in the ctor. If it has
// acquired a value that's actually meaningful, then it looks
- [lmi-commits] [lmi] master updated (b3e084f -> b36660c), Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master af5a41d 2/9: Demonstrate the nugatoriness of composite_lapse_year_,
Greg Chicares <=
- [lmi-commits] [lmi] master b957c49 1/9: Rewrite write_tsv(), Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a useless one, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 579a4f4 3/9: Simplify [378], Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master fac6d21 8/9: Rename local variables in one function, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 4c6e6c3 6/9: Prefer bourn_cast to static_cast for arithmetic type conversions, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master b36660c 9/9: Define short aliases early; use them wherever possible, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 18f1ca3 7/9: Refactor to remove duplication, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 797a8b8 5/9: Rename a member function, Greg Chicares, 2018/10/04