2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-02 06:55:16 +00:00

[#109,!21] Prefix calls to distance() with std:: in libdhcp++.cc

This commit is contained in:
Thomas Markwalder
2018-09-10 06:53:47 -04:00
parent b04a68a0b0
commit 4a88f764d0

View File

@@ -419,14 +419,14 @@ size_t LibDHCP::unpackOptions6(const OptionBuffer& buf,
// We previously did the lookup only for dhcp6 option space, but with the // We previously did the lookup only for dhcp6 option space, but with the
// addition of S46 options, we now do it for every space. // addition of S46 options, we now do it for every space.
range = idx.equal_range(opt_type); range = idx.equal_range(opt_type);
num_defs = distance(range.first, range.second); num_defs = std::distance(range.first, range.second);
// Standard option definitions do not include the definition for // Standard option definitions do not include the definition for
// our option or we're searching for non-standard option. Try to // our option or we're searching for non-standard option. Try to
// find the definition among runtime option definitions. // find the definition among runtime option definitions.
if (num_defs == 0) { if (num_defs == 0) {
range = runtime_idx.equal_range(opt_type); range = runtime_idx.equal_range(opt_type);
num_defs = distance(range.first, range.second); num_defs = std::distance(range.first, range.second);
} }
OptionPtr opt; OptionPtr opt;
@@ -538,14 +538,14 @@ size_t LibDHCP::unpackOptions4(const OptionBuffer& buf,
// may be standard options in other spaces (e.g. radius). So we now do // may be standard options in other spaces (e.g. radius). So we now do
// the lookup for every space. // the lookup for every space.
range = idx.equal_range(opt_type); range = idx.equal_range(opt_type);
num_defs = distance(range.first, range.second); num_defs = std::distance(range.first, range.second);
// Standard option definitions do not include the definition for // Standard option definitions do not include the definition for
// our option or we're searching for non-standard option. Try to // our option or we're searching for non-standard option. Try to
// find the definition among runtime option definitions. // find the definition among runtime option definitions.
if (num_defs == 0) { if (num_defs == 0) {
range = runtime_idx.equal_range(opt_type); range = runtime_idx.equal_range(opt_type);
num_defs = distance(range.first, range.second); num_defs = std::distance(range.first, range.second);
} }
// Check if option unpacking must be deferred // Check if option unpacking must be deferred
@@ -638,7 +638,7 @@ size_t LibDHCP::unpackVendorOptions6(const uint32_t vendor_id,
idx->equal_range(opt_type); idx->equal_range(opt_type);
// Get the number of returned option definitions for the // Get the number of returned option definitions for the
// option code. // option code.
size_t num_defs = distance(range.first, range.second); size_t num_defs = std::distance(range.first, range.second);
if (num_defs > 1) { if (num_defs > 1) {
// Multiple options of the same code are not supported // Multiple options of the same code are not supported
@@ -746,7 +746,7 @@ size_t LibDHCP::unpackVendorOptions4(const uint32_t vendor_id, const OptionBuffe
idx->equal_range(opt_type); idx->equal_range(opt_type);
// Get the number of returned option definitions for // Get the number of returned option definitions for
// the option code. // the option code.
size_t num_defs = distance(range.first, range.second); size_t num_defs = std::distance(range.first, range.second);
if (num_defs > 1) { if (num_defs > 1) {
// Multiple options of the same code are not // Multiple options of the same code are not