diff options
author | David Kalnischkies <david@kalnischkies.de> | 2019-07-08 15:48:59 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2019-07-08 15:51:17 +0200 |
commit | 2b734a7ec429825c7007c1093883229e069d36c7 (patch) | |
tree | b67360f3201634c82f5a9e7dd84f47b28fa63acb /apt-pkg/deb/debmetaindex.cc | |
parent | cbe90ee516d7f747f981e423f164f99eb767240b (diff) |
Apply various suggestions by cppcheck
Reported-By: cppcheck
Diffstat (limited to 'apt-pkg/deb/debmetaindex.cc')
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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<std::string> parsePlusMinusOptions(std::string const &Name, std::map<std::string, std::string> const &Options, std::vector<std::string> const &defaultValues) @@ -1095,8 +1095,8 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ { std::vector<std::string> 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; } |