mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-24 06:29:03 +01:00
Minor efficiency improvement in move_rules()
This commit is contained in:
parent
c9e57c93a2
commit
7120a73f0e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user