mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Migrate table-based for-loops to key-value iteration
This commit is contained in:
parent
41c7b229d3
commit
01d303b480
36 changed files with 150 additions and 153 deletions
|
@ -37,10 +37,10 @@ function describe_file(f: fa_file): string
|
|||
if ( f$source != "FTP" )
|
||||
return "";
|
||||
|
||||
for ( cid in f$conns )
|
||||
for ( cid, c in f$conns )
|
||||
{
|
||||
if ( f$conns[cid]?$ftp )
|
||||
return FTP::describe(f$conns[cid]$ftp);
|
||||
if ( c?$ftp )
|
||||
return FTP::describe(c$ftp);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -295,9 +295,9 @@ event connection_state_remove(c: connection) &priority=-5
|
|||
{
|
||||
if ( ! c?$ftp ) return;
|
||||
|
||||
for ( ca in c$ftp$pending_commands )
|
||||
for ( ca, cmdarg in c$ftp$pending_commands )
|
||||
{
|
||||
c$ftp$cmdarg = c$ftp$pending_commands[ca];
|
||||
c$ftp$cmdarg = cmdarg;
|
||||
ftp_message(c$ftp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,9 +91,8 @@ function get_pending_cmd(pc: PendingCmds, reply_code: count, reply_msg: string):
|
|||
local best_seq = 0;
|
||||
local best_score: int = -1;
|
||||
|
||||
for ( cmd_seq in pc )
|
||||
for ( cmd_seq, cmd in pc )
|
||||
{
|
||||
local cmd = pc[cmd_seq];
|
||||
local score: int = 0;
|
||||
|
||||
# if the command is compatible with the reply code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue