diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-28 20:29:53 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-28 20:29:53 (GMT) |
commit | 5722dd9e411ed52a0b840afc47b468c3ed1970c1 (patch) | |
tree | 7871561c0a2a83a6c86886442ebe3e7ddb36049c /src/ModuleCache.cc | |
parent | c0fa353e063c2075f6e1920f483bfa7142c4345e (diff) |
Minor refactoring, no longer automatically reloads if a dependency disappears
Diffstat (limited to 'src/ModuleCache.cc')
-rw-r--r-- | src/ModuleCache.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ModuleCache.cc b/src/ModuleCache.cc index 0e443e8..5ebd549 100644 --- a/src/ModuleCache.cc +++ b/src/ModuleCache.cc @@ -38,6 +38,9 @@ FileModule *ModuleCache::evaluate(const std::string &filename) memset(&st, 0, sizeof(struct stat)); bool valid = (stat(filename.c_str(), &st) == 0); + // If file isn't there, just return and let the cache retain the old module + if (!valid) return NULL; + std::string cache_id = str(boost::format("%x.%x") % st.st_mtime % st.st_size); // Lookup in cache @@ -46,12 +49,9 @@ FileModule *ModuleCache::evaluate(const std::string &filename) if (this->entries[filename].cache_id == cache_id) { shouldCompile = false; - BOOST_FOREACH(const FileModule::IncludeContainer::value_type &include, lib_mod->includes) { - if (lib_mod->include_modified(include.second)) { - lib_mod = NULL; - shouldCompile = true; - break; - } + if (lib_mod->includesChanged()) { + lib_mod = NULL; + shouldCompile = true; } } } |