Use unshift rather than splice for readability

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-04-10 09:25:29 -07:00
parent 2e443df8e3
commit 76b9ef7005

View File

@ -758,12 +758,12 @@ sub move_rules( $$ ) {
trace( $chain2, 'A', ++$rule, $_ ) for @{$chain1->{rules}};
}
splice @{$rules}, 0, 0, @{$chain1->{rules}};
unshift @{$rules}, @{$chain1->{rules}};
#
# In a firewall->x policy chain, multiple DHCP ACCEPT rules can be moved to the head of the chain.
# This hack avoids that.
#
shift @{$rules} if @{$rules} > 1 && $rules->[0] eq $rules->[1];
shift @{$rules} while @{$rules} > 1 && $rules->[0] eq $rules->[1];
$chain2->{referenced} = 1;
delete_chain $chain1;