From 6832578fe3197f4c367f26cb98b22858fd4db6b2 Mon Sep 17 00:00:00 2001 From: jasjuang Date: Fri, 22 Dec 2017 21:23:57 -0800 Subject: [PATCH 1/2] [opencv] update to 3.4.0 --- ports/opencv/CONTROL | 2 +- ports/opencv/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 2c80e5767b..e71ad109da 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,5 +1,5 @@ Source: opencv -Version: 3.3.1-9 +Version: 3.4.0 Build-Depends: zlib, libpng, libjpeg-turbo, tiff, protobuf (windows) Description: computer vision library diff --git a/ports/opencv/portfile.cmake b/ports/opencv/portfile.cmake index b309edb89e..5e3c98555b 100644 --- a/ports/opencv/portfile.cmake +++ b/ports/opencv/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv - REF 3.3.1 - SHA512 ee228953b621be022c203e3d60b06be524bd134ba6188c447216ee89e14dfddeac7d6aaf85c5a0b0008b010254e2aa711813bfdb691a77b0bdba33682c6ca68c + REF 3.4.0 + SHA512 aa7e475f356ffdaeb2ae9f7e9380c92cae58fabde9cd3b23c388f9190b8fde31ee70d16648042d0c43c03b2ff1f15e4be950be7851133ea0aa82cf6e42ba4710 HEAD_REF master ) @@ -21,8 +21,8 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty/libjpeg ${SOURCE_PATH}/3rdparty/libp vcpkg_from_github( OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib - REF 3.3.1 - SHA512 b5f35f68faab811a440b6af6b33c766dcdf4cc8547c0a4ed3a6a3da80ca8ae77618039d94bee6d249e96899765bdbb34c997bd7ee53d864c43427eff92f7ea34 + REF 3.4.0 + SHA512 53f6127304f314d3be834f79520d4bc8a75e14cad8c9c14a66a7a6b37908ded114d24e3a2c664d4ec2275903db08ac826f29433e810c6400f3adc2714a3c5be7 HEAD_REF master ) From 332414111dcc1eee316aa93c1c5e74699a521709 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 23 Dec 2017 07:29:12 -0800 Subject: [PATCH 2/2] Revert "clang-tidy fixes" This reverts commit 2d0a76370ead152896411d17aa19934235b93d1c. --- toolsrc/include/vcpkg/sourceparagraph.h | 3 +- toolsrc/include/vcpkg/versiont.h | 2 +- toolsrc/src/vcpkg.cpp | 14 +++++---- toolsrc/src/vcpkg/base/chrono.cpp | 2 +- toolsrc/src/vcpkg/base/cofffilereader.cpp | 2 +- toolsrc/src/vcpkg/base/files.cpp | 4 +-- toolsrc/src/vcpkg/build.cpp | 11 +++---- toolsrc/src/vcpkg/commands.cache.cpp | 2 +- toolsrc/src/vcpkg/commands.create.cpp | 2 +- toolsrc/src/vcpkg/commands.exportifw.cpp | 6 ++-- toolsrc/src/vcpkg/commands.integrate.cpp | 2 +- toolsrc/src/vcpkg/commands.list.cpp | 2 +- toolsrc/src/vcpkg/export.cpp | 4 +-- toolsrc/src/vcpkg/install.cpp | 2 +- toolsrc/src/vcpkg/metrics.cpp | 37 ++++++++++++----------- toolsrc/src/vcpkg/remove.cpp | 4 +-- toolsrc/src/vcpkg/sourceparagraph.cpp | 6 ++-- toolsrc/src/vcpkg/statusparagraphs.cpp | 2 +- toolsrc/src/vcpkg/update.cpp | 3 +- toolsrc/src/vcpkg/userconfig.cpp | 2 +- toolsrc/src/vcpkg/vcpkgpaths.cpp | 4 +-- toolsrc/src/vcpkg/versiont.cpp | 2 +- 22 files changed, 60 insertions(+), 58 deletions(-) diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index 58e76b7b1a..dcbbc1c3b2 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -14,12 +14,11 @@ namespace vcpkg { struct Dependency { - static Dependency parse_dependency(std::string&& name, std::string&& qualifier); - Features depend; std::string qualifier; std::string name() const; + static Dependency parse_dependency(std::string name, std::string qualifier); }; std::vector filter_dependencies(const std::vector& deps, const Triplet& t); diff --git a/toolsrc/include/vcpkg/versiont.h b/toolsrc/include/vcpkg/versiont.h index 0ffb4d602a..6d8332521f 100644 --- a/toolsrc/include/vcpkg/versiont.h +++ b/toolsrc/include/vcpkg/versiont.h @@ -6,7 +6,7 @@ namespace vcpkg struct VersionT { VersionT(); - VersionT(std::string&& value); + VersionT(const std::string& value); const std::string& to_string() const; diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 08dd3fcf6e..094ea1dc5d 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -4,7 +4,7 @@ #pragma warning(push) #pragma warning(disable : 4768) -#include +#include #pragma warning(pop) #else #include @@ -21,8 +21,10 @@ #include #include #include +#include #include +#include #include #include @@ -47,7 +49,7 @@ static void inner(const VcpkgCmdArguments& args) Checks::exit_fail(VCPKG_LINE_INFO); } - static const auto FIND_COMMAND = [&](auto&& commands) { + static const auto find_command = [&](auto&& commands) { auto it = Util::find_if(commands, [&](auto&& commandc) { return Strings::case_insensitive_ascii_equals(commandc.name, args.command); }); @@ -60,7 +62,7 @@ static void inner(const VcpkgCmdArguments& args) return static_cast(nullptr); }; - if (const auto command_function = FIND_COMMAND(Commands::get_available_commands_type_c())) + if (const auto command_function = find_command(Commands::get_available_commands_type_c())) { return command_function->function(args); } @@ -134,7 +136,7 @@ static void inner(const VcpkgCmdArguments& args) } } - if (const auto command_function = FIND_COMMAND(Commands::get_available_commands_type_b())) + if (const auto command_function = find_command(Commands::get_available_commands_type_b())) { return command_function->function(args, paths); } @@ -159,7 +161,7 @@ static void inner(const VcpkgCmdArguments& args) Input::check_triplet(default_triplet, paths); - if (const auto command_function = FIND_COMMAND(Commands::get_available_commands_type_a())) + if (const auto command_function = find_command(Commands::get_available_commands_type_a())) { return command_function->function(args, paths, default_triplet); } @@ -212,7 +214,7 @@ static void load_config() static std::string trim_path_from_command_line(const std::string& full_command_line) { Checks::check_exit( - VCPKG_LINE_INFO, !full_command_line.empty(), "Internal failure - cannot have empty command line"); + VCPKG_LINE_INFO, full_command_line.size() > 0, "Internal failure - cannot have empty command line"); if (full_command_line[0] == '"') { diff --git a/toolsrc/src/vcpkg/base/chrono.cpp b/toolsrc/src/vcpkg/base/chrono.cpp index d83106c8b4..00f8ba3f1e 100644 --- a/toolsrc/src/vcpkg/base/chrono.cpp +++ b/toolsrc/src/vcpkg/base/chrono.cpp @@ -15,7 +15,7 @@ namespace vcpkg::Chrono using std::chrono::nanoseconds; using std::chrono::seconds; - const auto nanos_as_double = static_cast(nanos.count()); + const double nanos_as_double = static_cast(nanos.count()); if (duration_cast(nanos) > hours()) { diff --git a/toolsrc/src/vcpkg/base/cofffilereader.cpp b/toolsrc/src/vcpkg/base/cofffilereader.cpp index 27426eb0a1..1927e0b5e3 100644 --- a/toolsrc/src/vcpkg/base/cofffilereader.cpp +++ b/toolsrc/src/vcpkg/base/cofffilereader.cpp @@ -223,7 +223,7 @@ namespace vcpkg::CoffFileReader static const char* FILE_START = "!\n"; static const size_t FILE_START_SIZE = 8; - fs.seekg(fstream::beg); + fs.seekg(fs.beg); char file_start[FILE_START_SIZE]; fs.read(file_start, FILE_START_SIZE); diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index 7e4cfbf6a2..8c9e137ed5 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -18,9 +18,9 @@ namespace vcpkg::Files return std::make_error_code(std::errc::no_such_file_or_directory); } - file_stream.seekg(0, std::fstream::end); + file_stream.seekg(0, file_stream.end); auto length = file_stream.tellg(); - file_stream.seekg(0, std::fstream::beg); + file_stream.seekg(0, file_stream.beg); if (length > SIZE_MAX) { diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 16f7a400f7..f43d8788e2 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -60,8 +60,7 @@ namespace vcpkg::Build::Command spec.name()); const StatusParagraphs status_db = database_load_check(paths); - const Build::BuildPackageOptions build_package_options{ - Build::UseHeadVersion::NO, Build::AllowDownloads::YES, Build::CleanBuildtrees::NO}; + const Build::BuildPackageOptions build_package_options{Build::UseHeadVersion::NO, Build::AllowDownloads::YES}; const std::unordered_set features_as_set(full_spec.features.begin(), full_spec.features.end()); @@ -193,7 +192,7 @@ namespace vcpkg::Build for (auto&& host : host_architectures) { - const auto it = Util::find_if(toolset.supported_architectures, [&](const ToolsetArchOption& opt) { + auto it = Util::find_if(toolset.supported_architectures, [&](const ToolsetArchOption& opt) { return host == opt.host_arch && target_arch == opt.target_arch; }); if (it != toolset.supported_architectures.end()) return it->name; @@ -295,7 +294,7 @@ namespace vcpkg::Build { features.append(feature + ";"); } - if (!features.empty()) + if (features.size() > 0) { features.pop_back(); } @@ -365,7 +364,7 @@ namespace vcpkg::Build if (config.build_package_options.clean_buildtrees == CleanBuildtrees::YES) { auto& fs = paths.get_filesystem(); - const auto buildtrees_dir = paths.buildtrees / spec.name(); + auto buildtrees_dir = paths.buildtrees / spec.name(); auto buildtree_files = fs.get_files_non_recursive(buildtrees_dir); for (auto&& file : buildtree_files) { @@ -501,7 +500,7 @@ namespace vcpkg::Build const std::vector lines = Strings::split(ec_data.output, "\n"); - PreBuildInfo pre_build_info{}; + PreBuildInfo pre_build_info; const auto e = lines.cend(); auto cur = std::find(lines.cbegin(), e, FLAG_GUID); diff --git a/toolsrc/src/vcpkg/commands.cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp index 85bf5fb4d9..6fd123b7c2 100644 --- a/toolsrc/src/vcpkg/commands.cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -47,7 +47,7 @@ namespace vcpkg::Commands::Cache Checks::exit_success(VCPKG_LINE_INFO); } - if (args.command_arguments.empty()) + if (args.command_arguments.size() == 0) { for (const BinaryParagraph& binary_paragraph : binary_paragraphs) { diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp index 25c34cf097..44f5f79286 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -34,7 +34,7 @@ namespace vcpkg::Commands::Create R"(Filename cannot contain invalid chars %s, but was %s)", Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name); - cmake_args.emplace_back("FILENAME", zip_file_name); + cmake_args.push_back({"FILENAME", zip_file_name}); } const std::string cmd_launch_cmake = make_cmake_cmd(cmake_exe, paths.ports_cmake, cmake_args); diff --git a/toolsrc/src/vcpkg/commands.exportifw.cpp b/toolsrc/src/vcpkg/commands.exportifw.cpp index 96c0e22153..682267acb5 100644 --- a/toolsrc/src/vcpkg/commands.exportifw.cpp +++ b/toolsrc/src/vcpkg/commands.exportifw.cpp @@ -139,14 +139,14 @@ namespace vcpkg::Export::IFW )###", create_release_date())); - for (const auto& unique_package : unique_packages) + for (auto package = unique_packages.begin(); package != unique_packages.end(); ++package) { - const ExportPlanAction& action = *(unique_package.second); + const ExportPlanAction& action = *(package->second); const BinaryParagraph& binary_paragraph = action.any_paragraph.binary_control_file.value_or_exit(VCPKG_LINE_INFO).core_paragraph; package_xml_file_path = - raw_exported_dir_path / Strings::format("packages.%s", unique_package.first) / "meta" / "package.xml"; + raw_exported_dir_path / Strings::format("packages.%s", package->first) / "meta" / "package.xml"; package_xml_dir_path = package_xml_file_path.parent_path(); fs.create_directories(package_xml_dir_path, ec); Checks::check_exit(VCPKG_LINE_INFO, diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index 0f647a40f2..460e99b888 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -191,7 +191,7 @@ namespace vcpkg::Commands::Integrate const auto found = std::regex_search(*contents_data, match, RE); if (found) { - const auto ver = strtol(match[1].str().c_str(), nullptr, 10); + const int ver = atoi(match[1].str().c_str()); if (ver >= 1) should_install_system = false; } } diff --git a/toolsrc/src/vcpkg/commands.list.cpp b/toolsrc/src/vcpkg/commands.list.cpp index 66939a68a9..960c572250 100644 --- a/toolsrc/src/vcpkg/commands.list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -57,7 +57,7 @@ namespace vcpkg::Commands::List return lhs->package.displayname() < rhs->package.displayname(); }); - if (args.command_arguments.empty()) + if (args.command_arguments.size() == 0) { for (const StatusParagraph* status_paragraph : installed_packages) { diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index 11e810339e..e3221a12f0 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -69,8 +69,8 @@ namespace vcpkg::Export { static constexpr std::array ORDER = {ExportPlanType::ALREADY_BUILT, ExportPlanType::PORT_AVAILABLE_BUT_NOT_BUILT}; - static constexpr Build::BuildPackageOptions build_options = { - Build::UseHeadVersion::NO, Build::AllowDownloads::YES, Build::CleanBuildtrees::NO}; + static constexpr Build::BuildPackageOptions build_options = {Build::UseHeadVersion::NO, + Build::AllowDownloads::YES}; for (const ExportPlanType plan_type : ORDER) { diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 88c9d8882f..dcc130be34 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -159,7 +159,7 @@ namespace vcpkg::Install 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 as_string; + return std::move(as_string); }); return SortedVector(std::move(package_files)); diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 818a9066cf..cdb21d2606 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -152,7 +152,7 @@ namespace vcpkg::Metrics void track_property(const std::string& name, const std::string& value) { - if (!properties.empty()) properties.push_back(','); + if (properties.size() != 0) properties.push_back(','); properties.append(to_json_string(name)); properties.push_back(':'); properties.append(to_json_string(value)); @@ -160,7 +160,7 @@ namespace vcpkg::Metrics void track_metric(const std::string& name, double value) { - if (!measurements.empty()) measurements.push_back(','); + if (measurements.size() != 0) measurements.push_back(','); measurements.append(to_json_string(name)); measurements.push_back(':'); measurements.append(std::to_string(value)); @@ -302,7 +302,7 @@ namespace vcpkg::Metrics { if (MAXDWORD <= payload.size()) abort(); std::wstring hdrs = L"Content-Type: application/json\r\n"; - auto& p = const_cast(payload); + std::string& p = const_cast(payload); results = WinHttpSendRequest(request, hdrs.c_str(), static_cast(hdrs.size()), @@ -383,27 +383,30 @@ namespace vcpkg::Metrics auto& fs = Files::get_real_filesystem(); - const fs::path exe_path = [&fs]() -> fs::path { - auto vcpkgdir = System::get_exe_path_of_current_process().parent_path(); - auto path = vcpkgdir / "vcpkgmetricsuploader.exe"; - if (fs.exists(path)) return path; + if (true) + { + const fs::path exe_path = [&fs]() -> fs::path { + auto vcpkgdir = System::get_exe_path_of_current_process().parent_path(); + auto path = vcpkgdir / "vcpkgmetricsuploader.exe"; + if (fs.exists(path)) return path; - path = vcpkgdir / "scripts" / "vcpkgmetricsuploader.exe"; - if (fs.exists(path)) return path; + path = vcpkgdir / "scripts" / "vcpkgmetricsuploader.exe"; + if (fs.exists(path)) return path; - return ""; - }(); + return ""; + }(); - std::error_code ec; - fs.create_directories(temp_folder_path, ec); - if (ec) return; - fs.copy_file(exe_path, temp_folder_path_exe, fs::copy_options::skip_existing, ec); - if (ec) return; + std::error_code ec; + fs.create_directories(temp_folder_path, ec); + if (ec) return; + fs.copy_file(exe_path, temp_folder_path_exe, fs::copy_options::skip_existing, ec); + if (ec) return; + } const fs::path vcpkg_metrics_txt_path = temp_folder_path / ("vcpkg" + generate_random_UUID() + ".txt"); fs.write_contents(vcpkg_metrics_txt_path, payload); - const std::string cmd_line = Strings::format(R"(start "vcpkgmetricsuploader.exe" "%s" "%s")", + const std::string cmd_line = Strings::format("start \"vcpkgmetricsuploader.exe\" \"%s\" \"%s\"", temp_folder_path_exe.u8string(), vcpkg_metrics_txt_path.u8string()); System::cmd_execute_clean(cmd_line); diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp index ed2c02b9fa..4079d60c1d 100644 --- a/toolsrc/src/vcpkg/remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -202,7 +202,7 @@ namespace vcpkg::Remove std::vector specs; if (Util::Sets::contains(options.switches, OPTION_OUTDATED)) { - if (!args.command_arguments.empty()) + if (args.command_arguments.size() != 0) { System::println(System::Color::error, "Error: 'remove' accepts either libraries or '--outdated'"); Checks::exit_fail(VCPKG_LINE_INFO); @@ -221,7 +221,7 @@ namespace vcpkg::Remove } else { - if (args.command_arguments.empty()) + if (args.command_arguments.size() < 1) { System::println(System::Color::error, "Error: 'remove' accepts either libraries or '--outdated'"); Checks::exit_fail(VCPKG_LINE_INFO); diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index 4da0cfcfc8..2a9480538b 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -158,7 +158,7 @@ namespace vcpkg return std::move(control_file); } - Dependency Dependency::parse_dependency(std::string&& name, std::string&& qualifier) + Dependency Dependency::parse_dependency(std::string name, std::string qualifier) { Dependency dep; dep.qualifier = qualifier; @@ -182,7 +182,7 @@ namespace vcpkg { return Util::fmap(depends, [&](const std::string& depend_string) -> Dependency { auto pos = depend_string.find(' '); - if (pos == std::string::npos) return Dependency::parse_dependency(std::string{depend_string}, ""); + if (pos == std::string::npos) return Dependency::parse_dependency(depend_string, ""); // expect of the form "\w+ \[\w+\]" Dependency dep; @@ -190,7 +190,7 @@ namespace vcpkg if (depend_string.c_str()[pos + 1] != '(' || depend_string[depend_string.size() - 1] != ')') { // Error, but for now just slurp the entire string. - return Dependency::parse_dependency(std::string{depend_string}, ""); + return Dependency::parse_dependency(depend_string, ""); } dep.qualifier = depend_string.substr(pos + 2, depend_string.size() - pos - 3); return dep; diff --git a/toolsrc/src/vcpkg/statusparagraphs.cpp b/toolsrc/src/vcpkg/statusparagraphs.cpp index d516b62843..d4afc0427e 100644 --- a/toolsrc/src/vcpkg/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg/statusparagraphs.cpp @@ -47,7 +47,7 @@ namespace vcpkg StatusParagraphs::const_iterator StatusParagraphs::find_installed(const std::string& name, const Triplet& triplet) const { - const auto it = find(name, triplet); + const const_iterator it = find(name, triplet); if (it != end() && (*it)->want == Want::INSTALL && (*it)->state == InstallState::INSTALLED) { return it; diff --git a/toolsrc/src/vcpkg/update.cpp b/toolsrc/src/vcpkg/update.cpp index 9f89da13c3..d6c5614ed2 100644 --- a/toolsrc/src/vcpkg/update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -35,8 +35,7 @@ namespace vcpkg::Update auto&& installed_version = pgh->package.version; if (installed_version != port_version) { - output.push_back( - {pgh->package.spec, VersionDiff(std::string{installed_version}, std::string{port_version})}); + output.push_back({pgh->package.spec, VersionDiff(installed_version, port_version)}); } } else diff --git a/toolsrc/src/vcpkg/userconfig.cpp b/toolsrc/src/vcpkg/userconfig.cpp index 45ed01ec63..9065946910 100644 --- a/toolsrc/src/vcpkg/userconfig.cpp +++ b/toolsrc/src/vcpkg/userconfig.cpp @@ -41,7 +41,7 @@ namespace vcpkg const auto& pghs = *p_pghs; std::unordered_map keys; - if (!pghs.empty()) keys = pghs[0]; + if (pghs.size() > 0) keys = pghs[0]; for (size_t x = 1; x < pghs.size(); ++x) { diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index cbf1e97e19..e64a681e2d 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -50,14 +50,14 @@ namespace vcpkg const std::string& version_check_arguments, const std::array& expected_version) { - const auto it = Util::find_if(candidate_paths, [&](const fs::path& p) { + auto it = Util::find_if(candidate_paths, [&](const fs::path& p) { const std::string cmd = Strings::format(R"("%s" %s)", p.u8string(), version_check_arguments); return exists_and_has_equal_or_greater_version(cmd, expected_version); }); if (it != candidate_paths.cend()) { - return *it; + return std::move(*it); } return nullopt; diff --git a/toolsrc/src/vcpkg/versiont.cpp b/toolsrc/src/vcpkg/versiont.cpp index cff49d9e88..91f7e23efa 100644 --- a/toolsrc/src/vcpkg/versiont.cpp +++ b/toolsrc/src/vcpkg/versiont.cpp @@ -6,7 +6,7 @@ namespace vcpkg { VersionT::VersionT() : value("0.0.0") {} - VersionT::VersionT(std::string&& value) : value(std::move(value)) {} + VersionT::VersionT(const std::string& value) : value(value) {} const std::string& VersionT::to_string() const { return value; } bool operator==(const VersionT& left, const VersionT& right) { return left.to_string() == right.to_string(); } bool operator!=(const VersionT& left, const VersionT& right) { return left.to_string() != right.to_string(); }