From 0a8dbe086a23bbb905514007d21e2e04cdaae1e8 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 4 Feb 2025 18:26:39 +0100 Subject: IExecutionApi: Use unordered_set in IsAvailable --- src/buildtool/execution_api/common/common_api.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/common/common_api.hpp') diff --git a/src/buildtool/execution_api/common/common_api.hpp b/src/buildtool/execution_api/common/common_api.hpp index 991b9875..d5daa3dd 100644 --- a/src/buildtool/execution_api/common/common_api.hpp +++ b/src/buildtool/execution_api/common/common_api.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "gsl/gsl" @@ -39,7 +40,7 @@ /// to some given original type. template struct MissingArtifactsInfo { - std::vector digests; + std::unordered_set digests; std::unordered_map back_map; }; @@ -69,7 +70,7 @@ template TIterator const& end, typename std::function const& converter) noexcept -> std::optional> { - std::vector digests; + std::unordered_set digests; digests.reserve(std::distance(begin, end)); MissingArtifactsInfo res{}; for (auto it = begin; it != end; ++it) { @@ -77,7 +78,7 @@ template auto const inserted = res.back_map.insert({std::invoke(converter, *it), *it}); if (inserted.second) { - digests.emplace_back(inserted.first->first); + digests.emplace(inserted.first->first); } } catch (...) { return std::nullopt; -- cgit v1.2.3