From 2b734a7ec429825c7007c1093883229e069d36c7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jul 2019 15:48:59 +0200 Subject: Apply various suggestions by cppcheck Reported-By: cppcheck --- apt-pkg/deb/debmetaindex.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 71e047257..a88b19807 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -986,7 +986,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ return std::find(minus.begin(), minus.end(), v) != minus.end(); }), Values.end()); } - return Values; + return std::move(Values); } static std::vector parsePlusMinusOptions(std::string const &Name, std::map const &Options, std::vector const &defaultValues) @@ -1095,8 +1095,8 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ { std::vector ret; ret.reserve(Options.size()); - for (auto &&O: Options) - ret.emplace_back(O.first); + std::transform(Options.begin(), Options.end(), std::back_inserter(ret), + [](auto &&O) { return O.first; }); std::sort(ret.begin(), ret.end()); return ret; } -- cgit v1.2.3