mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Remove loop_over_queue (as an example for later removing loop_over_list)
This commit is contained in:
parent
a4e2cfa2be
commit
bf70dad395
3 changed files with 4 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue