aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_ci.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-17 02:39:14 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-06-20 09:36:21 -0700
commit8741214bf69d1209a1e6d405ed8561d27f04436a (patch)
tree85325eb4b2d2c1c15eb8bd58426dac5462242d4e /toolsrc/src/commands_ci.cpp
parent8c4d55b8f304c74aeb95878cfe354830ff4abc88 (diff)
downloadvcpkg-8741214bf69d1209a1e6d405ed8561d27f04436a.tar.gz
vcpkg-8741214bf69d1209a1e6d405ed8561d27f04436a.zip
[vcpkg] Use unique_ptr<> for paragraphs. Post-parser phase rework.
Diffstat (limited to 'toolsrc/src/commands_ci.cpp')
-rw-r--r--toolsrc/src/commands_ci.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp
index 65e44e847..7ffc7577a 100644
--- a/toolsrc/src/commands_ci.cpp
+++ b/toolsrc/src/commands_ci.cpp
@@ -8,6 +8,7 @@
#include "vcpkg_Files.h"
#include "vcpkg_Input.h"
#include "vcpkg_System.h"
+#include "vcpkg_Util.h"
#include "vcpkglib.h"
namespace vcpkg::Commands::CI
@@ -21,14 +22,10 @@ namespace vcpkg::Commands::CI
const Triplet& triplet)
{
auto ports = Paragraphs::load_all_ports(fs, ports_directory);
- std::vector<PackageSpec> specs;
- for (const SourceControlFile& control_file : ports)
- {
- const SourceParagraph& p = control_file.core_paragraph;
- specs.push_back(PackageSpec::from_name_and_triplet(p.name, triplet).value_or_exit(VCPKG_LINE_INFO));
- }
-
- return specs;
+ return Util::fmap(ports, [&](auto&& control_file) -> PackageSpec {
+ return PackageSpec::from_name_and_triplet(control_file->core_paragraph->name, triplet)
+ .value_or_exit(VCPKG_LINE_INFO);
+ });
}
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet)