summaryrefslogtreecommitdiff
path: root/apt-private/private-install.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2019-07-08 15:48:59 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2019-07-08 15:51:17 +0200
commit2b734a7ec429825c7007c1093883229e069d36c7 (patch)
treeb67360f3201634c82f5a9e7dd84f47b28fa63acb /apt-private/private-install.cc
parentcbe90ee516d7f747f981e423f164f99eb767240b (diff)
Apply various suggestions by cppcheck
Reported-By: cppcheck
Diffstat (limited to 'apt-private/private-install.cc')
-rw-r--r--apt-private/private-install.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index a5a88c99d..af6697d7f 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -727,8 +727,7 @@ bool AddVolatileSourceFile(pkgSourceList *const SL, PseudoPkg &&pkg, std::vector
return false;
std::vector<std::string> files;
SL->AddVolatileFile(pkg.name, &files);
- for (auto &&f: files)
- VolatileCmdL.emplace_back(std::move(f), pkg.arch, pkg.release, pkg.index);
+ std::transform(files.begin(), files.end(), std::back_inserter(VolatileCmdL), [&](auto &&f) { return PseudoPkg{std::move(f), pkg.arch, pkg.release, pkg.index}; });
return true;
}
@@ -740,8 +739,7 @@ bool AddVolatileBinaryFile(pkgSourceList *const SL, PseudoPkg &&pkg, std::vector
return false;
std::vector<std::string> files;
SL->AddVolatileFile(pkg.name, &files);
- for (auto &&f: files)
- VolatileCmdL.emplace_back(std::move(f), pkg.arch, pkg.release, pkg.index);
+ std::transform(files.begin(), files.end(), std::back_inserter(VolatileCmdL), [&](auto &&f) { return PseudoPkg{std::move(f), pkg.arch, pkg.release, pkg.index}; });
return true;
}
/*}}}*/