Use Strings::join() and Strings::format()

This commit is contained in:
Alexander Karatarakis 2017-09-01 17:22:55 -07:00
parent db06c7fa69
commit 35a9d223bc

View File

@ -170,17 +170,10 @@ namespace vcpkg
std::string Dependency::name() const
{
std::string str = this->depend.name;
if (this->depend.features.empty()) return str;
if (this->depend.features.empty()) return this->depend.name;
str += "[";
for (auto&& s : this->depend.features)
{
str += s + ",";
}
str.pop_back();
str += "]";
return str;
const std::string features = Strings::join(",", this->depend.features);
return Strings::format("%s[%s]", this->depend.name, features);
}
std::vector<Dependency> vcpkg::expand_qualified_dependencies(const std::vector<std::string>& depends)