mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-10 23:43:58 +03:00
find_package: Use map::emplace instead of make_pair
Replace map::insert(make_pair(...) with map::emplace(...). This should be slightly more efficient, but also removes one of only two uses of std::pair. (Upcoming changes are going to remove the other, which will let us drop use of <utility>.)
This commit is contained in:
1 parent
14ed8464c8
commit
bd542748af
1 file changed
+4
-8
@@ -549,14 +549,10 @@ void cmFindPackageCommand::AppendSearchPathGroups()
|
||||
PathLabel::SystemRegistry);
|
||||
|
||||
// Create the new path objects
|
||||
this->LabeledPaths.insert(
|
||||
std::make_pair(PathLabel::PackageRedirect, cmSearchPath(this)));
|
||||
this->LabeledPaths.insert(
|
||||
std::make_pair(PathLabel::UserRegistry, cmSearchPath(this)));
|
||||
this->LabeledPaths.insert(
|
||||
std::make_pair(PathLabel::Builds, cmSearchPath(this)));
|
||||
this->LabeledPaths.insert(
|
||||
std::make_pair(PathLabel::SystemRegistry, cmSearchPath(this)));
|
||||
this->LabeledPaths.emplace(PathLabel::PackageRedirect, cmSearchPath{ this });
|
||||
this->LabeledPaths.emplace(PathLabel::UserRegistry, cmSearchPath{ this });
|
||||
this->LabeledPaths.emplace(PathLabel::Builds, cmSearchPath{ this });
|
||||
this->LabeledPaths.emplace(PathLabel::SystemRegistry, cmSearchPath{ this });
|
||||
}
|
||||
|
||||
bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
|
||||
|
||||
Reference in new issue
Block a user