]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Read file in do_hash_file as Bytes
authorClemens Wasser <clemens.wasser@gmail.com>
Wed, 20 Mar 2024 12:40:31 +0000 (13:40 +0100)
committerClemens Wasser <clemens.wasser@gmail.com>
Wed, 20 Mar 2024 12:40:31 +0000 (13:40 +0100)
src/ccache/hashutil.cpp

index e783921cbf213d0ebe69599150695964b94ce2b0..efe978cbaf9cd33c5ce6aa16083d7ed39312f910 100644 (file)
@@ -194,7 +194,7 @@ do_hash_file(const Context& ctx,
   (void)ctx;
 #endif
 
-  const auto data = util::read_file<std::string>(path, size_hint);
+  const auto data = util::read_file<util::Bytes>(path, size_hint);
   if (!data) {
     LOG("Failed to read {}: {}", path, data.error());
     return HashSourceCodeResult(HashSourceCode::error);
@@ -202,7 +202,7 @@ do_hash_file(const Context& ctx,
 
   HashSourceCodeResult result;
   if (check_temporal_macros) {
-    result.insert(check_for_temporal_macros(*data));
+    result.insert(check_for_temporal_macros(util::to_string_view(*data)));
   }
 
   Hash hash;