From ef70431f02e2ec13ecedab7ac342574e52d1877b Mon Sep 17 00:00:00 2001 From: Herman Semenoff Date: Wed, 8 Apr 2026 11:51:08 +0300 Subject: apt: push to emplace C++11 if possible References: - https://www.reddit.com/r/cpp_questions/comments/pm63yx/why_clangtidy_says_use_emplace_back_instead_of/ - https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html --- cmdline/apt-cache.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmdline/apt-cache.cc') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index d8e9e7e4b..ce2d79102 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -586,8 +586,8 @@ static bool XVcg(CommandLine &CmdL) // Load the list of packages from the command line into the show list APT::CacheSetHelper helper(true, GlobalError::NOTICE); std::list mods; - mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::CacheSetHelper::PkgModifier::POSTFIX)); - mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::CacheSetHelper::PkgModifier::POSTFIX)); + mods.emplace_back(0, ",", APT::CacheSetHelper::PkgModifier::POSTFIX); + mods.emplace_back(1, "^", APT::CacheSetHelper::PkgModifier::POSTFIX); std::map pkgsets = APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper); @@ -799,8 +799,8 @@ static bool Dotty(CommandLine &CmdL) // Load the list of packages from the command line into the show list APT::CacheSetHelper helper(true, GlobalError::NOTICE); std::list mods; - mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::CacheSetHelper::PkgModifier::POSTFIX)); - mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::CacheSetHelper::PkgModifier::POSTFIX)); + mods.emplace_back(0, ",", APT::CacheSetHelper::PkgModifier::POSTFIX); + mods.emplace_back(1, "^", APT::CacheSetHelper::PkgModifier::POSTFIX); std::map pkgsets = APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper); -- cgit v1.2.3-70-g09d2