aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-08-29 16:20:21 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-08-29 16:20:46 -0700
commit5337adf1078f27c993f01662b7dadb8da2801356 (patch)
tree84d6dc9d137a03fb17956f37ed47578cb748b118 /toolsrc
parentd1d01075adf025690eeceffc2fc41f9a1a27982b (diff)
downloadvcpkg-5337adf1078f27c993f01662b7dadb8da2801356.tar.gz
vcpkg-5337adf1078f27c993f01662b7dadb8da2801356.zip
Remove Strings::is_empty(). Use std::string.empty()
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/include/vcpkg_Strings.h3
-rw-r--r--toolsrc/src/BinaryParagraph.cpp2
-rw-r--r--toolsrc/src/vcpkg_Dependencies.cpp6
-rw-r--r--toolsrc/src/vcpkg_Strings.cpp5
-rw-r--r--toolsrc/src/vcpkglib.cpp2
5 files changed, 6 insertions, 12 deletions
diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h
index 2607caf4c..61f6fab61 100644
--- a/toolsrc/include/vcpkg_Strings.h
+++ b/toolsrc/include/vcpkg_Strings.h
@@ -39,9 +39,6 @@ namespace vcpkg::Strings
static constexpr const char* EMPTY = "";
static constexpr const wchar_t* WEMPTY = L"";
- bool is_empty(const CStringView s);
- bool is_empty(const CWStringView s);
-
template<class... Args>
std::string format(const char* fmtstr, const Args&... args)
{
diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp
index 1ab1aa63e..1504912ab 100644
--- a/toolsrc/src/BinaryParagraph.cpp
+++ b/toolsrc/src/BinaryParagraph.cpp
@@ -89,7 +89,7 @@ namespace vcpkg
std::string BinaryParagraph::displayname() const
{
- const auto f = Strings::is_empty(this->feature) ? "core" : this->feature;
+ const auto f = this->feature.empty() ? "core" : this->feature;
return Strings::format("%s[%s]:%s", this->spec.name(), f, this->spec.triplet());
}
diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp
index 4d0c3c928..1a0f0a6ed 100644
--- a/toolsrc/src/vcpkg_Dependencies.cpp
+++ b/toolsrc/src/vcpkg_Dependencies.cpp
@@ -443,7 +443,7 @@ namespace vcpkg::Dependencies
MarkPlusResult mark_plus(const std::string& feature, Cluster& cluster, ClusterGraph& graph, GraphPlan& graph_plan)
{
- if (feature == "")
+ if (feature.empty())
{
// Indicates that core was not specified in the reference
return mark_plus("core", cluster, graph, graph_plan);
@@ -551,7 +551,7 @@ namespace vcpkg::Dependencies
auto& status_paragraph_feature = status_paragraph->package.feature;
// In this case, empty string indicates the "core" paragraph for a package.
- if (status_paragraph_feature == "")
+ if (status_paragraph_feature.empty())
{
cluster.original_features.insert("core");
}
@@ -573,7 +573,7 @@ namespace vcpkg::Dependencies
auto& dep_cluster = graph.get(dependency.spec());
auto depends_name = dependency.feature();
- if (depends_name == "") depends_name = "core";
+ if (depends_name.empty()) depends_name = "core";
auto& target_node = dep_cluster.edges[depends_name];
target_node.remove_edges.emplace_back(FeatureSpec{spec, status_paragraph_feature});
diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp
index d08898bce..15851829d 100644
--- a/toolsrc/src/vcpkg_Strings.cpp
+++ b/toolsrc/src/vcpkg_Strings.cpp
@@ -71,9 +71,6 @@ namespace vcpkg::Strings::details
namespace vcpkg::Strings
{
- bool is_empty(const CStringView s) { return s == EMPTY; }
- bool is_empty(const CWStringView s) { return s == WEMPTY; }
-
std::wstring to_utf16(const CStringView s)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conversion;
@@ -133,7 +130,7 @@ namespace vcpkg::Strings
trim(&s);
}
- Util::erase_remove_if(*strings, [](const std::string& s) { return Strings::is_empty(s); });
+ Util::erase_remove_if(*strings, [](const std::string& s) { return s.empty(); });
}
std::vector<std::string> split(const std::string& s, const std::string& delimiter)
diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp
index 9f47c9d61..14d062468 100644
--- a/toolsrc/src/vcpkglib.cpp
+++ b/toolsrc/src/vcpkglib.cpp
@@ -189,7 +189,7 @@ namespace vcpkg
for (const std::unique_ptr<StatusParagraph>& pgh : status_db)
{
- if (pgh->state != InstallState::INSTALLED || !Strings::is_empty(pgh->package.feature))
+ if (pgh->state != InstallState::INSTALLED || !pgh->package.feature.empty())
{
continue;
}