]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Simplify code for hashing include file
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 19 Jun 2020 19:00:38 +0000 (21:00 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 23 Jun 2020 19:44:45 +0000 (21:44 +0200)
src/ccache.cpp

index 41f1e633242eb07c25b9c986d1d0c280ef67413e..8ca07864420320637ae0396b6753a04f68ac8fa3 100644 (file)
@@ -348,29 +348,7 @@ do_remember_include_file(Context& ctx,
 
   if (ctx.config.direct_mode()) {
     if (!is_pch) { // else: the file has already been hashed.
-      int result;
-#ifdef INODE_CACHE_SUPPORTED
-      if (ctx.config.inode_cache()) {
-        result = hash_source_code_file(ctx, fhash, path.c_str());
-      } else {
-#endif
-        char* source = nullptr;
-        size_t size;
-        if (st.size() > 0) {
-          if (!read_file(path.c_str(), st.size(), &source, &size)) {
-            return false;
-          }
-        } else {
-          source = x_strdup("");
-          size = 0;
-        }
-
-        result =
-          hash_source_code_string(ctx, fhash, source, size, path.c_str());
-        free(source);
-#ifdef INODE_CACHE_SUPPORTED
-      }
-#endif
+      int result = hash_source_code_file(ctx, fhash, path.c_str());
       if (result & HASH_SOURCE_CODE_ERROR
           || result & HASH_SOURCE_CODE_FOUND_TIME) {
         return false;