]> git.tdb.fi Git - builder.git/commitdiff
Check the existence of dependencies beforehand rather than catching the exception
authorMikko Rasa <tdb@tdb.fi>
Fri, 8 Jun 2012 07:22:07 +0000 (10:22 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:52 +0000 (00:08 +0300)
source/csourcefile.cpp

index c231784753796466a9e9e33d60201c17531bac92..7c4c453b85be92c66991d58e32b3d0eaf9c24d8f 100644 (file)
@@ -29,20 +29,11 @@ void CSourceFile::find_depends()
 
        const SourcePackage &spkg = comp->get_package();
        string relname = FS::relative(path, spkg.get_source()).str();
-       DependencyCache &deps_cache = spkg.get_deps_cache();
-       bool deps_found = false;
-       if(mtime<deps_cache.get_mtime())
-       {
-               try
-               {
-                       includes = deps_cache.get_deps(relname);
-                       deps_found = true;
-               }
-               catch(const key_error &)
-               { }
-       }
 
-       if(!deps_found)
+       DependencyCache &deps_cache = spkg.get_deps_cache();
+       if(mtime<deps_cache.get_mtime() && deps_cache.has_deps(relname))
+               includes = deps_cache.get_deps(relname);
+       else
        {
                try
                {