From: Francis Dupont Date: Thu, 23 Jul 2020 07:35:09 +0000 (+0200) Subject: [#1333] Applied optimization from clang X-Git-Tag: Kea-1.8.0~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13e09fe602f1dd6646e9e4ede114386922e71173;p=thirdparty%2Fkea.git [#1333] Applied optimization from clang --- diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 5cc48e3722..95629d6fb6 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -1007,7 +1007,7 @@ Dhcpv6Srv::processDhcp6Query(Pkt6Ptr& query, Pkt6Ptr& rsp) { Lease6CollectionPtr deleted_leases(new Lease6Collection()); // Do per IA lists - for (auto const iac : ctx.ias_) { + for (auto const& iac : ctx.ias_) { if (!iac.old_leases_.empty()) { for (auto old_lease : iac.old_leases_) { if (ctx.new_leases_.empty()) { @@ -1015,7 +1015,7 @@ Dhcpv6Srv::processDhcp6Query(Pkt6Ptr& query, Pkt6Ptr& rsp) { continue; } bool in_new = false; - for (auto const new_lease : ctx.new_leases_) { + for (auto const& new_lease : ctx.new_leases_) { if ((new_lease->addr_ == old_lease->addr_) && (new_lease->prefixlen_ == old_lease->prefixlen_)) { in_new = true; diff --git a/src/hooks/dhcp/flex_option/flex_option.cc b/src/hooks/dhcp/flex_option/flex_option.cc index ec77c4450d..60c90f2d87 100644 --- a/src/hooks/dhcp/flex_option/flex_option.cc +++ b/src/hooks/dhcp/flex_option/flex_option.cc @@ -228,7 +228,7 @@ FlexOptionImpl::logAction(Action action, uint16_t code, repr << "'" << value << "'"; } else { repr << "0x" << hex; - for (const unsigned char& ch : value) { + for (const char& ch : value) { repr << setw(2) << setfill('0') << static_cast(ch); } }