From: Mukund Sivaraman Date: Mon, 27 Jan 2014 03:52:34 +0000 (+0530) Subject: [2749] Remove redundant checks X-Git-Tag: bind10-1.2.0beta1-release~104^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04f5b145f2e0ea8fc4ad30b7222198a91b3e5189;p=thirdparty%2Fkea.git [2749] Remove redundant checks --- diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc index b6c157b04a..1bfe351b5d 100644 --- a/src/lib/dhcp/option.cc +++ b/src/lib/dhcp/option.cc @@ -250,19 +250,12 @@ uint8_t Option::getUint8() { } uint16_t Option::getUint16() { - if (data_.size() < sizeof(uint16_t) ) { - isc_throw(OutOfRange, "Attempt to read uint16 from option " << type_ - << " that has size " << data_.size()); - } - + // readUint16() checks and throws OutOfRange if data_ is too small. return (readUint16(&data_[0], data_.size())); } uint32_t Option::getUint32() { - if (data_.size() < sizeof(uint32_t) ) { - isc_throw(OutOfRange, "Attempt to read uint32 from option " << type_ - << " that has size " << data_.size()); - } + // readUint32() checks and throws OutOfRange if data_ is too small. return (readUint32(&data_[0], data_.size())); }