Browse Source

[2749] Remove redundant checks

Mukund Sivaraman 11 years ago
parent
commit
04f5b145f2
1 changed files with 2 additions and 9 deletions
  1. 2 9
      src/lib/dhcp/option.cc

+ 2 - 9
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()));
 }