From 76b9ef7005cb9c80fd226f021b9e76ea67bb3dbd Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 10 Apr 2010 09:25:29 -0700 Subject: [PATCH] Use unshift rather than splice for readability Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index d9049e9c0..294ac41c0 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -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;