diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2025-04-17 11:23:06 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2025-04-17 13:20:31 +0200 |
commit | 396af1e29f7c2ab253f57569437423e5f7775959 (patch) | |
tree | c1db7729d2328f4d44216cb1e9e786ff76f62a2b | |
parent | 7a835652d1bf73706678f60d6b6c86d3da3ecbd8 (diff) | |
download | justbuild-396af1e29f7c2ab253f57569437423e5f7775959.tar.gz |
bazel_msg_factory: avoid copies in lambdas...
and while there, replace `auto` with explicit signatures.
-rw-r--r-- | src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp index ccc0f2d7..6c0c5ae4 100644 --- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp +++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp @@ -33,6 +33,7 @@ #include "src/buildtool/common/artifact_digest_factory.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_repo.hpp" +#include "src/buildtool/file_system/object_type.hpp" #include "src/utils/cpp/hex_string.hpp" #include "src/utils/cpp/path.hpp" @@ -771,8 +772,9 @@ auto BazelMsgFactory::CreateDirectoryDigestFromLocalTree( &root, &store_file, &store_dir, - &store_symlink](auto name, auto type) { - const auto full_name = root / name; + &store_symlink](std::filesystem::path const& name, + ObjectType type) { + const auto& full_name = root / name; if (IsTreeObject(type)) { // create and store sub directory auto digest = CreateDirectoryDigestFromLocalTree( @@ -845,7 +847,8 @@ auto BazelMsgFactory::CreateGitTreeDigestFromLocalTree( &root, &store_file, &store_tree, - &store_symlink](auto name, auto type) { + &store_symlink](std::filesystem::path const& name, + ObjectType type) { const auto full_name = root / name; if (IsTreeObject(type)) { // create and store sub directory |