[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9b2b7b4 2/7: Withdraw an unnecessary friendsh
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9b2b7b4 2/7: Withdraw an unnecessary friendship |
Date: |
Mon, 4 Mar 2019 12:06:41 -0500 (EST) |
branch: master
commit 9b2b7b42e86cf20ff7db702b0c245850b2c31d72
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Withdraw an unnecessary friendship
Now that all DBDictionary ctors call InitDB(), these lines in
'product_file_test.cpp':
- DBDictionary().Init(database_filename_);
+ DBDictionary d(database_filename_);
do the same thing and take about the same amount of time, so the
second is preferable because it's simpler and requires no friendship.
---
dbdict.hpp | 1 -
product_file_test.cpp | 7 ++++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dbdict.hpp b/dbdict.hpp
index 06e84bb..db93e59 100644
--- a/dbdict.hpp
+++ b/dbdict.hpp
@@ -41,7 +41,6 @@ class LMI_SO DBDictionary
{
friend class DatabaseDocument;
friend class input_test; // For test_product_database().
- friend class product_file_test; // For read_database_file().
friend class premium_tax_test; // For test_rates().
public:
diff --git a/product_file_test.cpp b/product_file_test.cpp
index cee08e3..063667d 100644
--- a/product_file_test.cpp
+++ b/product_file_test.cpp
@@ -130,9 +130,14 @@ void product_file_test::test_copying()
BOOST_TEST( 99 == g.query<int>(DB_MaxIncrAge));
}
+// This implementation:
+// auto d = 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().Init(database_filename_);
+ DBDictionary d(database_filename_);
}
void product_file_test::read_fund_file()
- [lmi-commits] [lmi] master updated (c79894b -> f241d25), Greg Chicares, 2019/03/04
- [lmi-commits] [lmi] master 9b2b7b4 2/7: Withdraw an unnecessary friendship,
Greg Chicares <=
- [lmi-commits] [lmi] master 9b0f657 1/7: Improve documentation, Greg Chicares, 2019/03/04
- [lmi-commits] [lmi] master ab481ed 4/7: Consolidate and renumber octal options, Greg Chicares, 2019/03/04
- [lmi-commits] [lmi] master 6ab9a90 5/7: Sort short options alphabetically, Greg Chicares, 2019/03/04
- [lmi-commits] [lmi] master 5477797 3/7: Add '--prospicience' command-line argument for CLI binary, Greg Chicares, 2019/03/04
- [lmi-commits] [lmi] master 5de4ac2 6/7: Add an inchoate '--test_db' option, Greg Chicares, 2019/03/04
- [lmi-commits] [lmi] master f241d25 7/7: Make CLI and GUI getopt code more similar, Greg Chicares, 2019/03/04