summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_engine')
-rw-r--r--src/buildtool/execution_engine/executor/executor.hpp8
-rw-r--r--src/buildtool/execution_engine/tree_operations/tree_operations_utils.cpp11
2 files changed, 13 insertions, 6 deletions
diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp
index f009783d..5f5c2e92 100644
--- a/src/buildtool/execution_engine/executor/executor.hpp
+++ b/src/buildtool/execution_engine/executor/executor.hpp
@@ -632,8 +632,8 @@ class ExecutorImpl {
std::vector<DependencyGraph::NamedArtifactNodePtr> const& artifacts)
-> std::optional<ArtifactDigest> {
if (artifacts.size() == 1 and
- (artifacts.at(0).path == "." or artifacts.at(0).path.empty())) {
- auto const& info = artifacts.at(0).node->Content().Info();
+ (artifacts[0].path == "." or artifacts[0].path.empty())) {
+ auto const& info = artifacts[0].node->Content().Info();
if (info and IsTreeObject(info->type)) {
// Artifact list contains single tree with path "." or "". Reuse
// the existing tree artifact by returning its digest.
@@ -831,7 +831,7 @@ class ExecutorImpl {
msg << nlohmann::json(action->Env()).dump();
}
auto const& origin_map = progress->OriginMap();
- auto origins = origin_map.find(action->Content().Id());
+ auto const origins = origin_map.find(action->Content().Id());
if (origins != origin_map.end() and not origins->second.empty()) {
msg << "\nrequested by";
for (auto const& origin : origins->second) {
@@ -887,7 +887,7 @@ class ExecutorImpl {
remote_context->exec_config->dispatch) {
bool match = true;
for (auto const& [k, v] : pred) {
- auto v_it = properties.find(k);
+ auto const v_it = properties.find(k);
if (not(v_it != properties.end() and v_it->second == v)) {
match = false;
}
diff --git a/src/buildtool/execution_engine/tree_operations/tree_operations_utils.cpp b/src/buildtool/execution_engine/tree_operations/tree_operations_utils.cpp
index ecf08e8e..fb7d3bf0 100644
--- a/src/buildtool/execution_engine/tree_operations/tree_operations_utils.cpp
+++ b/src/buildtool/execution_engine/tree_operations/tree_operations_utils.cpp
@@ -221,9 +221,16 @@ auto TreeOperationsUtils::SerializeGitTree(
}
auto it = git_entries.find(*git_hash);
if (it == git_entries.end()) {
- git_entries.insert({*git_hash, std::vector<GitRepo::TreeEntry>{}});
+ if (auto res = git_entries.insert(
+ {*git_hash, std::vector<GitRepo::TreeEntry>{}});
+ res.second) {
+ it = std::move(res).first;
+ }
+ else {
+ return std::nullopt;
+ }
}
- git_entries.at(*git_hash).emplace_back(name, entry.info.type);
+ it->second.emplace_back(name, entry.info.type);
}
// Serialize git entries.