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/serve/mr_local_api.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/serve/mr_local_api.cpp') diff --git a/src/buildtool/execution_api/serve/mr_local_api.cpp b/src/buildtool/execution_api/serve/mr_local_api.cpp index 118fd564..5449b245 100644 --- a/src/buildtool/execution_api/serve/mr_local_api.cpp +++ b/src/buildtool/execution_api/serve/mr_local_api.cpp @@ -14,6 +14,7 @@ #include "src/buildtool/execution_api/serve/mr_local_api.hpp" +#include #include #include "src/buildtool/common/protocol_traits.hpp" @@ -123,8 +124,8 @@ auto MRLocalApi::IsAvailable(ArtifactDigest const& digest) const noexcept return compat_local_api_->IsAvailable(digest); } -auto MRLocalApi::IsAvailable(std::vector const& digests) - const noexcept -> std::vector { +auto MRLocalApi::IsAvailable(std::unordered_set const& digests) + const noexcept -> std::unordered_set { // This method can legitimately be called with both native and // compatible digests when in compatible mode, therefore we need to // interrogate the hash type of the input. @@ -134,7 +135,7 @@ auto MRLocalApi::IsAvailable(std::vector const& digests) return {}; // nothing to do } // native digests get dispatched to native local api - if (ProtocolTraits::IsNative(digests[0].GetHashType())) { + if (ProtocolTraits::IsNative(digests.begin()->GetHashType())) { return native_local_api_->IsAvailable(digests); } // compatible digests get dispatched to compatible local api -- cgit v1.2.3