[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c9f5266 2/4: Choose a better adverb: s/read_f
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c9f5266 2/4: Choose a better adverb: s/read_from_cache/read_via_cache/ |
Date: |
Tue, 9 Aug 2016 14:30:26 +0000 (UTC) |
branch: master
commit c9f526622d3ff445d1ece1c21edacd22d59780c3
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Choose a better adverb: s/read_from_cache/read_via_cache/
An object that has not yet been instantiated cannot have been cached,
and therefore cannot be read "from" the cache. Any object, cached or
not, can be read "via" the cache.
---
cache_file_reads.hpp | 3 ++-
cache_file_reads_test.cpp | 8 ++++----
database.cpp | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/cache_file_reads.hpp b/cache_file_reads.hpp
index 79478b3..ac64973 100644
--- a/cache_file_reads.hpp
+++ b/cache_file_reads.hpp
@@ -118,7 +118,8 @@ class cache_file_reads
///
/// Postcondition: returned pointer is not null; otherwise,
/// file_cache::retrieve_or_reload() throws.
- static retrieved_type read_from_cache(std::string const& filename)
+
+ static retrieved_type read_via_cache(std::string const& filename)
{
return file_cache<T>::instance().retrieve_or_reload(filename);
}
diff --git a/cache_file_reads_test.cpp b/cache_file_reads_test.cpp
index 33817ce..855cbb4 100644
--- a/cache_file_reads_test.cpp
+++ b/cache_file_reads_test.cpp
@@ -78,13 +78,13 @@ void cache_file_reads_test::test_preconditions()
// The cache is accessible with or without an object.
BOOST_TEST_EQUAL
- (x0.read_from_cache("sample.ill")->s()
- ,X::read_from_cache("sample.ill")->s()
+ (x0.read_via_cache("sample.ill")->s()
+ ,X::read_via_cache("sample.ill")->s()
);
// The file must exist.
BOOST_TEST_THROW
- (X::read_from_cache("no_such_file")
+ (X::read_via_cache("no_such_file")
,boost::filesystem::filesystem_error
,lmi_test::what_regex("no_such_file.*cannot find the file specified")
);
@@ -108,7 +108,7 @@ void cache_file_reads_test::mete_uncached()
void cache_file_reads_test::mete_cached()
{
- X const& x(*X::read_from_cache("sample.ill"));
+ X const& x(*X::read_via_cache("sample.ill"));
volatile std::string::size_type z = x.s().size();
}
diff --git a/database.cpp b/database.cpp
index 4bd03c3..c9bb513 100644
--- a/database.cpp
+++ b/database.cpp
@@ -204,7 +204,7 @@ void product_database::initialize(std::string const&
product_name)
else
{
std::string
filename(product_data(product_name).datum("DatabaseFilename"));
- db_ = DBDictionary::read_from_cache(AddDataDir(filename));
+ db_ = DBDictionary::read_via_cache(AddDataDir(filename));
}
maturity_age_ = static_cast<int>(Query(DB_MaturityAge));
length_ = maturity_age_ - index_.index_vector()[e_axis_issue_age];