diff --git a/src/vcpkg/binarycaching.cpp b/src/vcpkg/binarycaching.cpp index d4f78af37e..0247c924f2 100644 --- a/src/vcpkg/binarycaching.cpp +++ b/src/vcpkg/binarycaching.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -1010,8 +1011,7 @@ namespace void acquire_zips(View actions, Span> out_zip_paths) const override { - for (size_t idx = 0; idx < actions.size(); ++idx) - { + execute_in_parallel(actions.size(), [&](size_t idx) { auto&& action = *actions[idx]; const auto& abi = action.package_abi().value_or_exit(VCPKG_LINE_INFO); auto tmp = make_temp_archive_path(m_buildtrees, action.spec); @@ -1027,13 +1027,12 @@ namespace { out_sink.println_warning(res.error()); } - } + }); } void precheck(View actions, Span cache_status) const override { - for (size_t idx = 0; idx < actions.size(); ++idx) - { + execute_in_parallel(actions.size(), [&](size_t idx) { auto&& action = *actions[idx]; const auto& abi = action.package_abi().value_or_exit(VCPKG_LINE_INFO); auto maybe_res = m_tool->stat(make_object_path(m_prefix, abi)); @@ -1045,7 +1044,7 @@ namespace { cache_status[idx] = CacheAvailability::unavailable; } - } + }); } LocalizedString restored_message(size_t count,