mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18: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;
|
StmtLocMapping* hit = 0;
|
||||||
loop_over_queue(*map, i)
|
for ( const auto entry : *map )
|
||||||
{
|
{
|
||||||
StmtLocMapping* entry = (*map)[i];
|
plr.filename = entry->Loc().filename;
|
||||||
plr.filename = (*map)[i]->Loc().filename;
|
|
||||||
|
|
||||||
if ( entry->Loc().first_line > plr.line )
|
if ( entry->Loc().first_line > plr.line )
|
||||||
break;
|
break;
|
||||||
|
@ -389,7 +388,7 @@ vector<ParseLocationRec> parse_location_string(const string& s)
|
||||||
if ( plr.line >= entry->Loc().first_line &&
|
if ( plr.line >= entry->Loc().first_line &&
|
||||||
plr.line <= entry->Loc().last_line )
|
plr.line <= entry->Loc().last_line )
|
||||||
{
|
{
|
||||||
hit = (*map)[i];
|
hit = entry;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,10 +240,4 @@ protected:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using PQueue = Queue<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 */
|
#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;
|
stp_last_time = stp_resume_time = t;
|
||||||
|
|
||||||
Event(stp_resume_endp, stp_id);
|
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() )
|
if ( ep->endp->TCP() != endp->TCP() )
|
||||||
{
|
{
|
||||||
Ref(ep);
|
Ref(ep);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue