Remove loop_over_queue (as an example for later removing loop_over_list)

This commit is contained in:
Tim Wojtulewicz 2019-06-27 15:57:18 -07:00 committed by Jon Siwek
parent a4e2cfa2be
commit bf70dad395
3 changed files with 4 additions and 12 deletions

View file

@ -378,10 +378,9 @@ vector<ParseLocationRec> parse_location_string(const string& s)
}
StmtLocMapping* hit = 0;
loop_over_queue(*map, i)
for ( const auto entry : *map )
{
StmtLocMapping* entry = (*map)[i];
plr.filename = (*map)[i]->Loc().filename;
plr.filename = entry->Loc().filename;
if ( entry->Loc().first_line > plr.line )
break;
@ -389,7 +388,7 @@ vector<ParseLocationRec> parse_location_string(const string& s)
if ( plr.line >= entry->Loc().first_line &&
plr.line <= entry->Loc().last_line )
{
hit = (*map)[i];
hit = entry;
break;
}
}

View file

@ -240,10 +240,4 @@ protected:
template<typename T>
using PQueue = Queue<T*>;
// Macro to visit each queue element in turn.
#define loop_over_queue(queue, iterator) \
int iterator; \
for ( iterator = (queue).front(); iterator != (queue).back(); \
(queue).incr(iterator) )
#endif /* queue_h */

View file

@ -108,9 +108,8 @@ int SteppingStoneEndpoint::DataSent(double t, uint64 seq, int len, int caplen,
stp_last_time = stp_resume_time = t;
Event(stp_resume_endp, stp_id);
loop_over_queue(stp_manager->OrderedEndpoints(), i)
for ( auto ep : stp_manager->OrderedEndpoints() )
{
SteppingStoneEndpoint* ep = stp_manager->OrderedEndpoints()[i];
if ( ep->endp->TCP() != endp->TCP() )
{
Ref(ep);