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
44b85098
Commit
44b85098
authored
Jan 27, 2014
by
Mukund Sivaraman
Browse files
[2749] Replace size() calls with literal values
This gives us a very tiny speedup, as size() was a const method already.
parent
45809d98
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp6/dhcp6_srv.cc
View file @
44b85098
...
...
@@ -604,11 +604,12 @@ Dhcpv6Srv::generateServerID() {
seconds
-=
DUID_TIME_EPOCH
;
OptionBuffer
srvid
(
8
+
iface
->
getMacLen
());
writeUint16
(
DUID
::
DUID_LLT
,
&
srvid
[
0
],
srvid
.
size
());
writeUint16
(
HWTYPE_ETHERNET
,
&
srvid
[
2
],
srvid
.
size
()
-
2
);
writeUint32
(
static_cast
<
uint32_t
>
(
seconds
),
&
srvid
[
4
],
srvid
.
size
()
-
4
);
memcpy
(
&
srvid
[
0
]
+
8
,
iface
->
getMac
(),
iface
->
getMacLen
());
// We know that the buffer is at least 8 bytes long at this
// point.
writeUint16
(
DUID
::
DUID_LLT
,
&
srvid
[
0
],
2
);
writeUint16
(
HWTYPE_ETHERNET
,
&
srvid
[
2
],
2
);
writeUint32
(
static_cast
<
uint32_t
>
(
seconds
),
&
srvid
[
4
],
4
);
memcpy
(
&
srvid
[
8
],
iface
->
getMac
(),
iface
->
getMacLen
());
serverid_
=
OptionPtr
(
new
Option
(
Option
::
V6
,
D6O_SERVERID
,
srvid
.
begin
(),
srvid
.
end
()));
...
...
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