Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
04f5b145
Commit
04f5b145
authored
Jan 27, 2014
by
Mukund Sivaraman
Browse files
[2749] Remove redundant checks
parent
9eedd903
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/option.cc
View file @
04f5b145
...
...
@@ -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
()));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment