Skip to content

Commit

Permalink
Remove useless function enable_default_features
Browse files Browse the repository at this point in the history
The function enable_default_features was only called when "core" was not in dep.features, but the function only had an effect when default_features was false, but it is only false when "core" is in dep.features. So the function does nothing at all.
  • Loading branch information
autoantwort committed Aug 28, 2021
1 parent f9890ea commit 0e8fa97
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/vcpkg/dependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,8 +1329,6 @@ namespace vcpkg::Dependencies
const std::string& feature,
const std::string& origin);

void enable_default_features(std::pair<const PackageSpec, PackageNode>& ref, const std::string& origin);

void add_feature_to(std::pair<const PackageSpec, PackageNode>& ref,
VersionSchemeInfo& vsi,
const std::string& feature);
Expand Down Expand Up @@ -1520,22 +1518,6 @@ namespace vcpkg::Dependencies
}
}

void VersionedPackageGraph::enable_default_features(std::pair<const PackageSpec, PackageNode>& ref,
const std::string& origin)
{
(void)origin;
if (!ref.second.default_features)
{
ref.second.default_features = true;
ref.second.foreach_vsi([this, &ref](VersionSchemeInfo& vsi) {
for (auto&& f : vsi.scfl->source_control_file->core_paragraph->default_features)
{
this->add_feature_to(ref, vsi, f);
}
});
}
}

void VersionedPackageGraph::add_dependency_from(std::pair<const PackageSpec, PackageNode>& ref,
const Dependency& dep,
const std::string& origin)
Expand Down Expand Up @@ -1807,10 +1789,6 @@ namespace vcpkg::Dependencies
{
request_port_feature(node, f, toplevel.name());
}
if (Util::find(dep.features, "core") == dep.features.end())
{
enable_default_features(node, toplevel.name());
}
}
}

Expand Down

0 comments on commit 0e8fa97

Please sign in to comment.