lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 71e975b 1/3: Improve local names


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 71e975b 1/3: Improve local names
Date: Mon, 9 Nov 2020 17:12:08 -0500 (EST)

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

    Improve local names
    
    The best name for a lone local variable in a one-line function is 'z'.
    Soon a product_file_test::read_lingo_file() function will be added, and
    following the naming scheme here replaced by writing
        lingo l(lingo_filename_);
    would introduce the name 'l', which is generally avoided because it is
    too easily confused with the digit '1'.
---
 product_file_test.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/product_file_test.cpp b/product_file_test.cpp
index 149b08b..5077bf6 100644
--- a/product_file_test.cpp
+++ b/product_file_test.cpp
@@ -133,33 +133,33 @@ void product_file_test::test_copying()
 }
 
 // This implementation:
-//   auto d = DBDictionary::read_via_cache(database_filename_);
+//   auto z = DBDictionary::read_via_cache(database_filename_);
 // would cause assay_speed() to report a much faster run time,
 // yet such a timing would have little significance.
 
 void product_file_test::read_database_file()
 {
-    DBDictionary d(database_filename_);
+    DBDictionary z(database_filename_);
 }
 
 void product_file_test::read_fund_file()
 {
-    FundData f(fund_filename_);
+    FundData z(fund_filename_);
 }
 
 void product_file_test::read_policy_file()
 {
-    product_data p(policy_filename_);
+    product_data z(policy_filename_);
 }
 
 void product_file_test::read_rounding_file()
 {
-    rounding_rules r(rounding_filename_);
+    rounding_rules z(rounding_filename_);
 }
 
 void product_file_test::read_stratified_file()
 {
-    stratified_charges s(stratified_filename_);
+    stratified_charges z(stratified_filename_);
 }
 
 void product_file_test::assay_speed()



reply via email to

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