diff options
author | Marius Kintel <marius@kintel.net> | 2013-06-06 02:25:58 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-06-06 02:25:58 (GMT) |
commit | 626047f26d86079fe392bbd54d6e88a05cce85ef (patch) | |
tree | 2abe3d9bcb59c2c3dcbb4562d62015cc8ffed5b7 /src/ModuleCache.cc | |
parent | f49ba90cb51874671d8106ed89caeb0e9d6f3ae1 (diff) |
Minor refactoring of include checks
Diffstat (limited to 'src/ModuleCache.cc')
-rw-r--r-- | src/ModuleCache.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ModuleCache.cc b/src/ModuleCache.cc index 0e443e8..83f7b7d 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 @@ -45,13 +48,10 @@ FileModule *ModuleCache::evaluate(const std::string &filename) lib_mod = &(*this->entries[filename].module); 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; } } } |