Don't return by const copy
MODIFY
include/SourceParagraph.h
include/SourceParagraph.h
@@ -27,7 +27,7 @@ namespace vcpkg
// zlib[uwp] becomes Dependency{"zlib", "uwp"}
std::vector<Dependency> expand_qualified_dependencies(const std::vector<std::string>& depends);
- const std::string to_string(const Dependency& dep);
+ std::string to_string(const Dependency& dep);
struct FeatureParagraph
{

MODIFY
src/SourceParagraph.cpp
src/SourceParagraph.cpp
@@ -220,11 +220,7 @@ namespace vcpkg
return FeatureSpec::from_strings_and_triplet(filter_dependencies(deps, t), t);
}
- const std::string to_string(const Dependency& dep)
- {
- std::string name = dep.name();
- return name;
- }
+ std::string to_string(const Dependency& dep) { return dep.name(); }
ExpectedT<Supports, std::vector<std::string>> Supports::parse(const std::vector<std::string>& strs)
{

Don't return by const copy