From: Yoshitaka Aharen Date: Wed, 10 Oct 2012 08:06:15 +0000 (+0900) Subject: [2155] remove meaningless NULL check X-Git-Tag: trac2487_base~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c522619b6b3555c5fa0fc8367b6ebc4e72e9335d;p=thirdparty%2Fkea.git [2155] remove meaningless NULL check --- diff --git a/src/bin/auth/statistics.cc b/src/bin/auth/statistics.cc index a179a776dc..6ff5c52cb4 100644 --- a/src/bin/auth/statistics.cc +++ b/src/bin/auth/statistics.cc @@ -121,24 +121,21 @@ CountersImpl::inc(const QRAttributes& qrattrs, const Message& response) { unsigned int qtype_type = QR_QTYPE_OTHER; const QuestionIterator qiter = response.beginQuestion(); if (qiter != response.endQuestion()) { - // get the first and only question section - const QuestionPtr qptr = *qiter; - if (qptr != NULL) { - // get the qtype code - const unsigned int qtype = qptr->getType().getCode(); - if (qtype < 258) { - // qtype 0..257 - qtype_type = QRQTypeToQRCounterType[qtype]; - } else if (qtype < 32768) { - // qtype 258..32767 - qtype_type = QR_QTYPE_OTHER; - } else if (qtype < 32770) { - // qtype 32768..32769 - qtype_type = QR_QTYPE_TA + (qtype - 32768); - } else { - // qtype 32770..65535 - qtype_type = QR_QTYPE_OTHER; - } + // get the first and only question section and + // get the qtype code + const unsigned int qtype = (*qiter)->getType().getCode(); + if (qtype < 258) { + // qtype 0..257 + qtype_type = QRQTypeToQRCounterType[qtype]; + } else if (qtype < 32768) { + // qtype 258..32767 + qtype_type = QR_QTYPE_OTHER; + } else if (qtype < 32770) { + // qtype 32768..32769 + qtype_type = QR_QTYPE_TA + (qtype - 32768); + } else { + // qtype 32770..65535 + qtype_type = QR_QTYPE_OTHER; } } server_qr_counter_.inc(qtype_type);