summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2024-07-16 09:58:11 +0200
committerFrancis Dupont <fdupont@isc.org>2024-07-19 17:49:52 +0200
commit114674a3e3425172a7658140e31afb7fc4637310 (patch)
tree045a7d33322850982ca1bc5ce06817760a933c6d /src
parent[#3440] Typo (diff)
downloadkea-114674a3e3425172a7658140e31afb7fc4637310.tar.xz
kea-114674a3e3425172a7658140e31afb7fc4637310.zip
[#3440] Removed try catch block
Diffstat (limited to 'src')
-rw-r--r--src/lib/dhcp/libdhcp++.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc
index 87660b0515..108d3cbfd3 100644
--- a/src/lib/dhcp/libdhcp++.cc
+++ b/src/lib/dhcp/libdhcp++.cc
@@ -605,8 +605,9 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space,
offset += opt_len;
// Concatenate multiple instance of an option.
- try {
- size_t count = counts.at(opt_type);
+
+ if (counts.count(opt_type) > 0) {
+ size_t count = counts[opt_type];
OptionBuffer& previous = fused[opt_type];
previous.insert(previous.end(), obuf.begin(), obuf.end());
if (count <= 1) {
@@ -616,8 +617,6 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space,
counts[opt_type] = count - 1;
continue;
}
- } catch (const std::out_of_range&) {
- // Regular case.
}
// Get all definitions with the particular option code. Note