From 4a6b43c15a2b6c121686355f37443da6e2d05c9b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 18:55:27 -0700 Subject: Improve BinaryParagraph::displayname() --- toolsrc/src/BinaryParagraph.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'toolsrc/src/BinaryParagraph.cpp') diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index 783fa6ace..1ab1aa63e 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -89,14 +89,8 @@ namespace vcpkg std::string BinaryParagraph::displayname() const { - if (this->feature == "") - { - return this->spec.name() + "[core]:" + this->spec.triplet().to_string(); - } - else - { - return this->spec.name() + "[" + this->feature + "]:" + this->spec.triplet().to_string(); - } + const auto f = Strings::is_empty(this->feature) ? "core" : this->feature; + return Strings::format("%s[%s]:%s", this->spec.name(), f, this->spec.triplet()); } std::string BinaryParagraph::dir() const { return this->spec.dir(); } -- cgit v1.2.3