summaryrefslogtreecommitdiff
path: root/methods/mirror.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/mirror.cc')
-rw-r--r--methods/mirror.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc
index dcf4cbd13..3e382e497 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -56,7 +56,7 @@ class MirrorMethod : public aptMethod /*{{{*/
unsigned long priority = std::numeric_limits<decltype(priority)>::max();
decltype(genrng)::result_type seed = 0;
std::unordered_map<std::string, std::vector<std::string>> tags;
- MirrorInfo(std::string const &u, std::vector<std::string> &&ptags = {}) : uri(u)
+ explicit MirrorInfo(std::string const &u, std::vector<std::string> &&ptags = {}) : uri(u)
{
for (auto &&tag : ptags)
{
@@ -222,8 +222,7 @@ bool MirrorMethod::MirrorListFileRecieved(MirrorListInfo &info, FetchItem *const
[&access](char const *const a) { return APT::String::Endswith(access, std::string("+") + a); }) ||
access == "mirror")
{
- for (auto const &a : disallowLocal)
- limitAccess.emplace_back(a);
+ std::copy(std::begin(disallowLocal), std::end(disallowLocal), std::back_inserter(limitAccess));
}
std::string line;
while (mirrorlist.ReadLine(line))
@@ -323,12 +322,9 @@ std::string MirrorMethod::GetMirrorFileURI(std::string const &Message, FetchItem
if (plus < colon)
{
// started as tor+mirror+http we want to get the file via tor+http
- auto access = uristr.substr(0, colon);
- std::string prefixAccess;
+ auto const access = uristr.substr(0, colon);
if (APT::String::Startswith(access, "mirror") == false)
{
- prefixAccess = uristr.substr(0, plus);
- access.erase(0, plus + 1);
uristr.erase(plus, strlen("mirror") + 1);
return uristr;
}