Skip to content

Commit 0c81dc7

Browse files
committed
[#3440] Moved to a map of pairs
1 parent 799a4cb commit 0c81dc7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/dhcp/libdhcp++.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space,
530530
}
531531

532532
// Fusing option buffers.
533-
unordered_map<uint8_t, OptionBuffer> fused;
534-
unordered_map<uint8_t, uint32_t> seen;
533+
unordered_map<uint8_t, pair<OptionBuffer, uint32_t>> fused;
535534

536535
// Second pass.
537536
offset = 0;
@@ -595,9 +594,9 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space,
595594
// Concatenate multiple instance of an option.
596595
uint32_t opt_count = count[opt_type];
597596
if (opt_count > 1) {
598-
OptionBuffer& previous = fused[opt_type];
597+
OptionBuffer& previous = fused[opt_type].first;
599598
previous.insert(previous.end(), obuf.begin(), obuf.end());
600-
uint32_t& already_seen = seen[opt_type];
599+
uint32_t& already_seen = fused[opt_type].second;
601600
++already_seen;
602601
if (already_seen != opt_count) {
603602
continue;

0 commit comments

Comments
 (0)