lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 24cedf24 4/5: Decrease both disorder and ineq


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 24cedf24 4/5: Decrease both disorder and inequality
Date: Wed, 1 Jun 2022 17:06:25 -0400 (EDT)

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

    Decrease both disorder and inequality
    
    +Ordered    map: pc-linux-gnu == msw ('.lingo' files are identical)
    -Disordered map: pc-linux-gnu != msw (XML elements ordered differently)
    
    It is better for product files to be equal (identical) than equivalent,
    especially because, for these XML files, 'cmp' tests equality, but
    equivalence is rather more difficult to ascertain.
    
    The cost in run time is too tiny to measure: equality is free.
---
 lingo.cpp | 2 +-
 lingo.hpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lingo.cpp b/lingo.cpp
index 46f499cc..4fe707aa 100644
--- a/lingo.cpp
+++ b/lingo.cpp
@@ -263,7 +263,7 @@ void lingo::write_lingo_files()
     // that is not necessary, because superior::empty_string is used
     // for database entities with the default value of zero.
     //
-    static std::unordered_map<superior::lingo,std::string> const 
enumerative_map
+    static std::map<superior::lingo,std::string> const enumerative_map
         {{superior::empty_string                        , ""}
         // Essential strings describing the policy and company.
         ,{superior::policy_form_term                    , "{PolicyForm}"}
diff --git a/lingo.hpp b/lingo.hpp
index 25d49e08..edb8e675 100644
--- a/lingo.hpp
+++ b/lingo.hpp
@@ -29,8 +29,8 @@
 #include "so_attributes.hpp"
 #include "xml_lmi_fwd.hpp"
 
+#include <map>
 #include <string>
-#include <unordered_map>
 
 /// Company-specific lingo.
 
@@ -57,7 +57,7 @@ class LMI_SO lingo final
         ,std::string const&     file_basename
         );
 
-    std::unordered_map<int,std::string> map_;
+    std::map<int,std::string> map_;
 };
 
 #endif // lingo_hpp



reply via email to

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