From da7e8dced90e83dd7d699b1d5a269e60b186e226 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 27 Nov 2015 11:21:14 +0200 Subject: [PATCH] Fix remotebackend for loops --- modules/remotebackend/pipeconnector.cc | 2 +- modules/remotebackend/remotebackend.cc | 8 ++++---- modules/remotebackend/unixconnector.cc | 2 +- modules/remotebackend/zmqconnector.cc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/remotebackend/pipeconnector.cc b/modules/remotebackend/pipeconnector.cc index 0c6c05fba..fef490217 100644 --- a/modules/remotebackend/pipeconnector.cc +++ b/modules/remotebackend/pipeconnector.cc @@ -104,7 +104,7 @@ void PipeConnector::launch() { val.SetObject(); init.AddMember("parameters", val, init.GetAllocator()); - for(std::map::iterator i = options.begin(); i != options.end(); i++) { + for(auto i = options.begin(); i != options.end(); i++) { val = i->second.c_str(); init["parameters"].AddMember(i->first.c_str(), val, init.GetAllocator()); } diff --git a/modules/remotebackend/remotebackend.cc b/modules/remotebackend/remotebackend.cc index 00d5b1610..6c8be5bcd 100644 --- a/modules/remotebackend/remotebackend.cc +++ b/modules/remotebackend/remotebackend.cc @@ -118,7 +118,7 @@ int RemoteBackend::build() { stringtok(parts, opts, ","); // find out some options and parse them while we're at it - for(std::string opt : parts) { + for(const auto& opt: parts) { std::string key,val; // make sure there is something else than air in the option... if (opt.find_first_not_of(" ") == std::string::npos) continue; @@ -363,7 +363,7 @@ bool RemoteBackend::setDomainMetadata(const DNSName& name, const std::string& ki JSON_ADD_MEMBER_DNSNAME(parameters, "name", name, query.GetAllocator()); JSON_ADD_MEMBER(parameters, "kind", kind.c_str(), query.GetAllocator()); val.SetArray(); - for(std::string value : meta) { + for(const auto& value: meta) { val.PushBack(value.c_str(), query.GetAllocator()); } parameters.AddMember("value", val, query.GetAllocator()); @@ -815,7 +815,7 @@ bool RemoteBackend::feedEnts(int domain_id, map& nonterm) { JSON_ADD_MEMBER(parameters, "domain_id", domain_id, query.GetAllocator()); JSON_ADD_MEMBER(parameters, "trxid", d_trxid, query.GetAllocator()); nts.SetArray(); - for(auto t: nonterm) { + for(const auto& t: nonterm) { rapidjson::Value value(t.first.toString().c_str(), query.GetAllocator()); nts.PushBack(value, query.GetAllocator()); } @@ -842,7 +842,7 @@ bool RemoteBackend::feedEnts3(int domain_id, const DNSName& domain, map::iterator i = options.begin(); i != options.end(); i++) { + for(auto i = options.begin(); i != options.end(); i++) { val = i->second.c_str(); init["parameters"].AddMember(i->first.c_str(), val, init.GetAllocator()); } diff --git a/modules/remotebackend/zmqconnector.cc b/modules/remotebackend/zmqconnector.cc index c41520fb0..4ec00b07d 100644 --- a/modules/remotebackend/zmqconnector.cc +++ b/modules/remotebackend/zmqconnector.cc @@ -47,7 +47,7 @@ ZeroMQConnector::ZeroMQConnector(std::map options) { val.SetObject(); init.AddMember("parameters", val, init.GetAllocator()); - for(std::map::iterator i = options.begin(); i != options.end(); i++) { + for(auto i = options.begin(); i != options.end(); i++) { val = i->second.c_str(); init["parameters"].AddMember(i->first.c_str(), val, init.GetAllocator()); } -- 2.40.0