]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2749] Remove redundant checks
authorMukund Sivaraman <muks@isc.org>
Mon, 27 Jan 2014 03:52:34 +0000 (09:22 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 27 Jan 2014 03:52:34 +0000 (09:22 +0530)
src/lib/dhcp/option.cc

index b6c157b04ac6fa661e1505c194b82d49244860fe..1bfe351b5d939d78db61006fae0146f7b3d157df 100644 (file)
@@ -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()));
 }