diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-11 13:22:16 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-12 15:43:37 +0200 |
commit | 1e1758e8c30d30df0ebeefbada1e5a8f74d8a350 (patch) | |
tree | b5b87ab3d7b61a0dc0e89e14e28af78293c4a423 /src/buildtool/file_system/file_root.hpp | |
parent | 9362f6c426a6e10d0f77282364a0061ebf192375 (diff) | |
download | justbuild-1e1758e8c30d30df0ebeefbada1e5a8f74d8a350.tar.gz |
Use static Create functions to construct ArtifactDescription
...instead of unobvious ctors relying on overload resolution.
Diffstat (limited to 'src/buildtool/file_system/file_root.hpp')
-rw-r--r-- | src/buildtool/file_system/file_root.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp index db7ff07d..8b85f5a9 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -230,10 +230,10 @@ class FileRoot { if (auto id = data->Hash()) { auto const& size = data->Size(); if (size) { - return ArtifactDescription{ + return ArtifactDescription::CreateKnown( ArtifactDigest{*id, *size, /*is_tree=*/true}, ObjectType::Tree, - repository}; + repository); } } } catch (...) { @@ -575,23 +575,23 @@ class FileRoot { if (Compatibility::IsCompatible()) { auto compatible_hash = Compatibility::RegisterGitEntry( entry->Hash(), *entry->Blob(), repository); - return ArtifactDescription{ + return ArtifactDescription::CreateKnown( ArtifactDigest{compatible_hash, *entry->Size(), /*is_tree=*/false}, - entry->Type()}; + entry->Type()); } - return ArtifactDescription{ + return ArtifactDescription::CreateKnown( ArtifactDigest{ entry->Hash(), *entry->Size(), /*is_tree=*/false}, entry->Type(), - repository}; + repository); } } return std::nullopt; } if (std::holds_alternative<fs_root_t>(root_)) { - return ArtifactDescription{file_path, repository}; + return ArtifactDescription::CreateLocal(file_path, repository); } return std::nullopt; // absent roots are neither LOCAL nor KNOWN } |