From: Kees Monshouwer Date: Sun, 4 Oct 2020 19:18:34 +0000 (+0200) Subject: auth: remove always true conditions in zone2sql X-Git-Tag: auth-4.4.0-alpha2~50^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7176697df4e6759c566271889624f4d5ad7af3f;p=thirdparty%2Fpdns.git auth: remove always true conditions in zone2sql --- diff --git a/pdns/zone2sql.cc b/pdns/zone2sql.cc index 5b8c2bb6b5..ce80131565 100644 --- a/pdns/zone2sql.cc +++ b/pdns/zone2sql.cc @@ -114,26 +114,21 @@ static void startNewTransaction() static void emitDomain(const DNSName& domain, const vector *masters = 0) { string iDomain = domain.toStringRootDot(); if(!::arg().mustDo("slave")) { - if(g_mode==POSTGRES || g_mode==MYSQL || g_mode==SQLITE) { - cout<<"insert into domains (name,type) values ("<empty()) { - for(const auto& mstr : *masters) { - mstrs.append(mstr.toStringWithPortExcept(53)); - mstrs.append(1, ' '); - } + string mstrs; + if (masters != 0 && ! masters->empty()) { + for(const auto& mstr : *masters) { + mstrs.append(mstr.toStringWithPortExcept(53)); + mstrs.append(1, ' '); } - if (mstrs.empty()) - cout<<"insert into domains (name,type) values ("<