Use const reference for smart_ptr in BOOST_FOREACH
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 11 Feb 2015 16:47:08 +0000 (17:47 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 11 Feb 2015 16:47:08 +0000 (17:47 +0100)
src/icmp/icmppinger.cpp

index 703615b..0665040 100644 (file)
@@ -506,7 +506,7 @@ void IcmpPacketDistributor::handle_receive(
         {
             // check which pinger wants this packet
             bool packet_matches = false;
-            BOOST_FOREACH( IcmpPingerItem pinger, PingerList )
+            BOOST_FOREACH( const IcmpPingerItem &pinger, PingerList )
             {
                 packet_matches |= pinger->handle_receive_icmp_packet(
                                                 icmp_packet, bytes_transferred);
@@ -564,7 +564,9 @@ void IcmpPacketDistributor::clean_up_all()
 {
     BOOST_FOREACH( IcmpPacketDistributor::map_type::value_type &instance,
                                                                     Instances )
+    {
         instance.second->clean_up();
+    }
 
     Instances.clear();
 }