diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-09-13 10:45:08 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-09-13 15:14:30 +0200 |
commit | 50de44605471b930958524698e01579b6c67f7e7 (patch) | |
tree | 44fedd2726caba70f8ec5ad08088f0ddf1fa2d6f /src/buildtool/execution_api/execution_service/execution_server.cpp | |
parent | de61eefcf0b2574f44e9ec0e0d313aa52fdddbbb (diff) | |
download | justbuild-50de44605471b930958524698e01579b6c67f7e7.tar.gz |
Remove std::move of const value and avoid non-movable intermediate variables
Diffstat (limited to 'src/buildtool/execution_api/execution_service/execution_server.cpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/execution_server.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/buildtool/execution_api/execution_service/execution_server.cpp b/src/buildtool/execution_api/execution_service/execution_server.cpp index 2a1e8bca..61fd3434 100644 --- a/src/buildtool/execution_api/execution_service/execution_server.cpp +++ b/src/buildtool/execution_api/execution_service/execution_server.cpp @@ -287,19 +287,17 @@ namespace { LocalCasReader reader(&storage.CAS()); auto const tree = reader.MakeTree(digest); if (not tree) { - auto const error = - fmt::format("Failed to build bazel Tree for {}", digest.hash()); - return unexpected{std::move(error)}; + return unexpected{fmt::format("Failed to build bazel Tree for {}", + digest.hash())}; } auto const cas_digest = storage.CAS().StoreBlob(tree->SerializeAsString(), /*is_executable=*/false); if (not cas_digest) { - auto const error = fmt::format( + return unexpected{fmt::format( "Failed to add to the storage the bazel Tree for {}", - digest.hash()); - return unexpected{std::move(error)}; + digest.hash())}; } (*out_dir.mutable_tree_digest()) = ArtifactDigestFactory::ToBazel(*cas_digest); @@ -317,16 +315,14 @@ namespace { auto const cas_path = storage.CAS().BlobPath(digest, /*is_executable=*/false); if (not cas_path) { - auto const error = - fmt::format("Failed to recover the symlink for {}", digest.hash()); - return unexpected{std::move(error)}; + return unexpected{ + fmt::format("Failed to recover the symlink for {}", digest.hash())}; } auto content = FileSystemManager::ReadFile(*cas_path); if (not content) { - auto const error = fmt::format( - "Failed to read the symlink content for {}", digest.hash()); - return unexpected{std::move(error)}; + return unexpected{fmt::format( + "Failed to read the symlink content for {}", digest.hash())}; } *(out_link.mutable_target()) = *std::move(content); |