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 --- methods/rred.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'methods') diff --git a/methods/rred.cc b/methods/rred.cc index 836697a11..56b536a82 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -657,7 +657,7 @@ class RredMethod final : public aptMethod { std::string const FileName = Path + ".ed"; if (ExpectedHashes.usable() == false) return _error->Error("No hashes found for uncompressed patch: %s", FileName.c_str()); - patchfiles.push_back(PDiffFile(FileName, ExpectedHashes)); + patchfiles.emplace_back(FileName, ExpectedHashes); } else { @@ -675,7 +675,7 @@ class RredMethod final : public aptMethod { HashStringList const ExpectedHashes = ReadExpectedHashesForPatch(seen_patches, Message); if (ExpectedHashes.usable() == false) return _error->Error("No hashes found for uncompressed patch %d: %s", seen_patches, p->c_str()); - patchfiles.push_back(PDiffFile(*p, ExpectedHashes)); + patchfiles.emplace_back(*p, ExpectedHashes); ++seen_patches; } } -- cgit v1.2.3-70-g09d2