clang proposed optimizations
From clang 10 on FreeBSD 11.4:
dhcp6_srv.cc:1004:37: warning: loop variable 'new_lease' of type 'const boost::shared_ptr<isc::dhcp::Lease6>' creates a copy from type 'const boost::shared_ptr<isc::dhcp::Lease6>' [-Wrange-loop-construct]
for (auto const new_lease : ctx.new_leases_) {
^
dhcp6_srv.cc:1004:26: note: use reference type 'const boost::shared_ptr<isc::dhcp::Lease6> &' to prevent copying
for (auto const new_lease : ctx.new_leases_) {
^~~~~~~~~~~~~~~~~~~~~~
&
dhcp6_srv.cc:996:25: warning: loop variable 'iac' of type 'const isc::dhcp::AllocEngine::ClientContext6::IAContext' creates a copy from type 'const isc::dhcp::AllocEngine::ClientContext6::IAContext' [-Wrange-loop-construct]
for (auto const iac : ctx.ias_) {
^
dhcp6_srv.cc:996:14: note: use reference type 'const isc::dhcp::AllocEngine::ClientContext6::IAContext &' to prevent copying
for (auto const iac : ctx.ias_) {
^~~~~~~~~~~~~~~~
&
flex_option.cc:231:35: warning: loop variable 'ch' has type 'const unsigned char &' but is initialized with type 'const char' resulting in a copy [-Wrange-loop-construct]
for (const unsigned char& ch : value) {
^
flex_option.cc:231:14: note: use non-reference type 'unsigned char' to keep the copy or type 'const char &' to prevent copying
for (const unsigned char& ch : value) {
^~~~~~~~~~~~~~~~~~~~~~~~~
CXX libflexid_la-callouts.lo
callouts.cc:103:39: warning: loop variable 'ch' has type 'const unsigned char &' but is initialized with type 'char' resulting in a copy [-Wrange-loop-construct]
for (const unsigned char& ch : value) {
^
callouts.cc:103:18: note: use non-reference type 'unsigned char' to keep the copy or type 'const char &' to prevent copying
for (const unsigned char& ch : value) {
^~~~~~~~~~~~~~~~~~~~~~~~~