diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-04 18:26:39 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-07 14:58:04 +0100 |
commit | 0a8dbe086a23bbb905514007d21e2e04cdaae1e8 (patch) | |
tree | 06136cea09fa30d857cc4f23f15ea372dfe5ef47 /test/buildtool/execution_engine/executor/executor.test.cpp | |
parent | 3bc0b895258ba8aeb04ee48525036a0a9407c9cb (diff) | |
download | justbuild-0a8dbe086a23bbb905514007d21e2e04cdaae1e8.tar.gz |
IExecutionApi: Use unordered_set in IsAvailable
Diffstat (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp')
-rw-r--r-- | test/buildtool/execution_engine/executor/executor.test.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index a20a377f..b36e5fba 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -24,6 +24,7 @@ #include <optional> #include <string> #include <unordered_map> +#include <unordered_set> #include <utility> #include <variant> #include <vector> @@ -248,13 +249,14 @@ class TestApi : public IExecutionApi { return false; } } - [[nodiscard]] auto IsAvailable(std::vector<ArtifactDigest> const& digests) - const noexcept -> std::vector<ArtifactDigest> final { - std::vector<ArtifactDigest> result; + [[nodiscard]] auto IsAvailable( + std::unordered_set<ArtifactDigest> const& digests) const noexcept + -> std::unordered_set<ArtifactDigest> final { + std::unordered_set<ArtifactDigest> result; try { for (auto const& digest : digests) { if (not config_.artifacts.at(digest.hash()).available) { - result.push_back(digest); + result.emplace(digest); } } } catch (std::exception const& /* unused */) { |