diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-04-01 01:39:24 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-04-01 01:39:24 -0700 |
| commit | 05c9f77a4ae72b8339b027ccbe5a769fc627fe87 (patch) | |
| tree | 3e6988e283ae76b30108a9bca43c7266eb42bdc9 /toolsrc/src/commands_install.cpp | |
| parent | 162e9ce98f4dad24e271de3b3f14c189f73bf67d (diff) | |
| download | vcpkg-05c9f77a4ae72b8339b027ccbe5a769fc627fe87.tar.gz vcpkg-05c9f77a4ae72b8339b027ccbe5a769fc627fe87.zip | |
[vcpkg] Use fmap instead of std::transform.
Diffstat (limited to 'toolsrc/src/commands_install.cpp')
| -rw-r--r-- | toolsrc/src/commands_install.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 50ea0a603..e504cf8ee 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -116,14 +116,13 @@ namespace vcpkg::Commands::Install static ImmutableSortedVector<std::string> build_list_of_package_files(const fs::path& package_dir) { const std::vector<fs::path> package_file_paths = Files::recursive_find_all_files_in_dir(package_dir); - std::vector<std::string> package_files; const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash - std::transform(package_file_paths.cbegin(), package_file_paths.cend(), std::back_inserter(package_files), [package_remove_char_count](const fs::path& path) - { - std::string as_string = path.generic_string(); - as_string.erase(0, package_remove_char_count); - return std::move(as_string); - }); + auto package_files = Util::fmap(package_file_paths, [package_remove_char_count](const fs::path& path) + { + std::string as_string = path.generic_string(); + as_string.erase(0, package_remove_char_count); + return std::move(as_string); + }); return ImmutableSortedVector<std::string>::create(std::move(package_files)); } |
