// Secondly, pool specific options. Pools are defined within a subnet, so
// if there is no subnet, there is nothing to do.
if (ctx.subnet_) {
- for (auto resource : ctx.allocated_resources_) {
+ for (const auto& resource : ctx.allocated_resources_) {
PoolPtr pool =
ctx.subnet_->getPool(resource.getPrefixLength() == 128 ?
Lease::TYPE_NA : Lease::TYPE_PD,
void Dhcpv6Srv::classifyByVendor(const Pkt6Ptr& pkt) {
OptionVendorClassPtr vclass;
- for (auto opt : pkt->getOptions(D6O_VENDOR_CLASS)) {
+ for (const auto& opt : pkt->getOptions(D6O_VENDOR_CLASS)) {
vclass = boost::dynamic_pointer_cast<OptionVendorClass>(opt.second);
if (!vclass || vclass->getTuplesNum() == 0) {
continue;
}
// And finish by pools
- for (auto resource : ctx.allocated_resources_) {
+ for (const auto& resource : ctx.allocated_resources_) {
PoolPtr pool =
ctx.subnet_->getPool(resource.getPrefixLength() == 128 ?
Lease::TYPE_NA : Lease::TYPE_PD,
-// Copyright (C) 2019-2022 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
}
}
for (auto pair : getSubOptionConfigMap()) {
- for (auto sub_pair : pair.second) {
+ for (const auto& sub_pair : pair.second) {
const SubOptionConfigPtr& sub_cfg = sub_pair.second;
uint16_t sub_code = sub_cfg->getCode();
uint16_t opt_code = sub_cfg->getContainerCode();
isc_throw(TypeError, "Non-map Elements passed to removeIdentical");
}
- for (auto kv : a->mapValue()) {
+ for (const auto& kv : a->mapValue()) {
auto key = kv.first;
if (!b->contains(key) ||
!a->get(key)->equals(*b->get(key))) {
isc_throw(TypeError, "merge arguments not MapElements");
}
- for (auto kv : other->mapValue()) {
+ for (const auto& kv : other->mapValue()) {
auto key = kv.first;
auto value = kv.second;
if (value && value->getType() != Element::null) {
return (false);
}
// iterate on the first map
- for (auto kv : a->mapValue()) {
+ for (const auto& kv : a->mapValue()) {
// get the b value for the given keyword and recurse
ConstElementPtr item = b->get(kv.first);
if (!item || !isEquivalent0(kv.second, item, level - 1)) {
// Iterate over all the option descriptors in
// all the spaces and instantiate the options
// based on the given definitions.
- for (auto space : getOptionSpaceNames()) {
+ for (const auto& space : getOptionSpaceNames()) {
for (auto opt_desc : *(getAll(space))) {
if (createDescriptorOption(cfg_def, space, opt_desc)) {
// Option was recreated, let's replace the descriptor.
(option_space != DHCP6_OPTION_SPACE)) {
// For each option space name iterate over the existing options.
auto option_space_names = getOptionSpaceNames();
- for (auto option_space_from_list : option_space_names) {
+ for (const auto& option_space_from_list : option_space_names) {
// Get all options within the particular option space.
auto options_in_space = getAll(option_space_from_list);
for (auto option_it = options_in_space->begin();
}
// Sanity checks on built-in classes
- for (auto bn : builtinNames) {
+ for (const auto& bn : builtinNames) {
if (name == bn) {
if (required) {
isc_throw(DhcpConfigError, "built-in class '" << name
const Element::Position pos("<default-value>", 0, 0);
// Let's go over all parameters we have defaults for.
- for (auto def_value : defaults) {
+ for (const auto& def_value : defaults) {
// Try if such a parameter is there. If it is, let's
// skip it, because user knows best *cough*.
void
Subnet::initAllocatorsAfterConfigure() {
- for (auto allocator : allocators_) {
+ for (const auto& allocator : allocators_) {
allocator.second->initAfterConfigure();
}
}
if (next_key == "*" || json_path.empty()) {
// Then iterate through all the children.
result = Element::createMap();
- for (auto kv : element->mapValue()) {
+ for (const auto& kv : element->mapValue()) {
std::string const& key(kv.first);
ConstElementPtr const& value(kv.second);
-// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
void
StatContext::setMaxSampleCountAll(uint32_t max_samples) {
// Let's iterate over all stored statistics...
- for (auto s : stats_) {
+ for (const auto& s : stats_) {
// ... and set count limit for each statistic.
s.second->setMaxSampleCount(max_samples);
}