lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 7f9eece 07/10: Remove old caching from DBDict


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7f9eece 07/10: Remove old caching from DBDictionary (VS)
Date: Tue, 2 Aug 2016 12:35:20 +0000 (UTC)

branch: master
commit 7f9eece46a3d14482c9fe173a13823edbfd732f9
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Remove old caching from DBDictionary (VS)
    
    Reference:
      http://lists.nongnu.org/archive/html/lmi/2012-06/msg00008.html
---
 dbdict.cpp |   23 -----------------------
 dbdict.hpp |    4 ----
 2 files changed, 27 deletions(-)

diff --git a/dbdict.cpp b/dbdict.cpp
index c2311fe..acfb0c4 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -50,8 +50,6 @@
 
 template class xml_serializable<DBDictionary>;
 
-std::string DBDictionary::cached_filename_;
-
 namespace xml_serialize
 {
 template<> struct xml_io<database_entity>
@@ -436,41 +434,21 @@ void DBDictionary::ascribe_members()
 }
 
 /// Read and cache a database file.
-///
-/// Perform the expensive operation of reading the dictionary from
-/// file only if the cached file name doesn't match the new filename.
 
 void DBDictionary::Init(std::string const& filename)
 {
     LMI_ASSERT(!filename.empty());
-    if(filename == cached_filename_)
-        {
-        return;
-        }
 
     try
         {
-        cached_filename_ = filename;
         load(filename);
         }
     catch(...)
         {
-        InvalidateCache();
         report_exception();
         }
 }
 
-/// Cause next Init() call to read from file instead of using cache.
-///
-/// The implementation simply sets the cached filename to an empty
-/// string, which is its initial value upon (static) construction and
-/// cannot validly name any file.
-
-void DBDictionary::InvalidateCache()
-{
-    cached_filename_.clear();
-}
-
 /// Save file, invalidating the cache.
 ///
 /// If data are modified (by the GUI product editor) and saved under a
@@ -480,7 +458,6 @@ void DBDictionary::InvalidateCache()
 
 void DBDictionary::WriteDB(std::string const& filename) const
 {
-    InvalidateCache();
     save(filename);
 }
 
diff --git a/dbdict.hpp b/dbdict.hpp
index f825e9e..6069ca7 100644
--- a/dbdict.hpp
+++ b/dbdict.hpp
@@ -69,8 +69,6 @@ class LMI_SO DBDictionary
     void Add(database_entity const&);
     void InitDB();
 
-    static void InvalidateCache();
-
     // xml_serializable required implementation.
     virtual int                class_version() const;
     virtual std::string const& xml_root_name() const;
@@ -90,8 +88,6 @@ class LMI_SO DBDictionary
         ,std::string const&     file_leaf_name
         ) const;
 
-    static std::string cached_filename_;
-
     database_entity MinIssAge           ;
     database_entity MaxIssAge           ;
     database_entity MaxIncrAge          ;



reply via email to

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