From: Ralph Covelli Date: Fri, 12 May 2017 03:40:14 +0000 (+0100) Subject: Refactored some redundant loops in CommunicatorClass::go() X-Git-Tag: rec-4.1.0-alpha1~90^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56e646f55db6e66f9381b75fe638b45cbeaf5d09;p=thirdparty%2Fpdns.git Refactored some redundant loops in CommunicatorClass::go() --- diff --git a/pdns/communicator.cc b/pdns/communicator.cc index eff4f2bb74..6958a8ef3a 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -37,6 +37,21 @@ #include "arguments.hh" #include "packetcache.hh" +#define CommunicatorLoadArgsIntoSet(listname,listset) do { \ + vector parts; \ + stringtok(parts, ::arg()[(listname)], ", \t"); \ + for (vector::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) { \ + try { \ + ComboAddress caIp(*iter, 53); \ + (listset).insert(caIp.toStringWithPort()); \ + } \ + catch(PDNSException &e) { \ + L< parts; - stringtok(parts, ::arg()["also-notify"], ", \t"); - for (vector::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) { - try { - ComboAddress caIp(*iter, 53); - d_alsoNotify.insert(caIp.toStringWithPort()); - } - catch(PDNSException &e) { - L< forwards; - stringtok(forwards, ::arg()["forward-notify"], ", \t"); - for (vector::const_iterator iter = forwards.begin(); iter != forwards.end(); ++iter) { - try { - ComboAddress caIp(*iter, 53); - PacketHandler::s_forwardNotify.insert(caIp.toStringWithPort()); - } - catch(PDNSException &e) { - L<