File tree 1 file changed +3
-4
lines changed
nodelet_topic_tools/include/nodelet_topic_tools
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 41
41
#include < ros/ros.h>
42
42
#include < nodelet/nodelet.h>
43
43
#include < image_transport/image_transport.h>
44
+ #include < boost/foreach.hpp>
44
45
#include < boost/thread.hpp>
45
46
#include < string>
46
47
#include < vector>
@@ -145,9 +146,8 @@ class NodeletLazy: public nodelet::Nodelet
145
146
if (lazy_)
146
147
{
147
148
boost::mutex::scoped_lock lock (connection_mutex_);
148
- for ( size_t i = 0 ; i < publishers_. size (); i++ )
149
+ BOOST_FOREACH ( const ros::Publisher& pub, publishers_)
149
150
{
150
- ros::Publisher pub = publishers_[i];
151
151
if (pub.getNumSubscribers () > 0 )
152
152
{
153
153
if (connection_status_ != SUBSCRIBED)
@@ -166,9 +166,8 @@ class NodeletLazy: public nodelet::Nodelet
166
166
return ;
167
167
}
168
168
}
169
- for ( size_t i = 0 ; i < image_transport_publishers_. size (); i++ )
169
+ BOOST_FOREACH ( const image_transport::Publisher& pub, image_transport_publishers_)
170
170
{
171
- image_transport::Publisher pub = image_transport_publishers_[i];
172
171
if (pub.getNumSubscribers () > 0 )
173
172
{
174
173
if (connection_status_ != SUBSCRIBED)
You can’t perform that action at this time.
0 commit comments