From 7120a73f0e13ebd52854c553b8902e73a8a88a28 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 10 Nov 2009 08:08:02 -0800 Subject: [PATCH] Minor efficiency improvement in move_rules() --- Shorewall/Perl/Shorewall/Chains.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 55abc62a9..f7767371b 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -639,16 +639,15 @@ sub move_rules( $$ ) { my ($chain1, $chain2 ) = @_; if ( $chain1->{referenced} ) { - my @rules = @{$chain1->{rules}}; my $name = $chain1->{name}; # # We allow '+' in chain names and '+' is an RE meta-character. Escape it. # $name =~ s/\+/\\+/; - ( s/\-([AI]) $name /-$1 $chain2->{name} / ) for @rules; + ( s/\-([AI]) $name /-$1 $chain2->{name} / ) for @{$chain1->{rules}}; - splice @{$chain2->{rules}}, 0, 0, @rules; + splice @{$chain2->{rules}}, 0, 0, @{$chain1->{rules}}; $chain2->{referenced} = 1; $chain1->{referenced} = 0;