forked from extern/shorewall_code
Favor low-numbered less complex synonym chains in optimization 8.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
c958329d14
commit
b7273d6999
@ -3120,18 +3120,22 @@ sub optimize_level4( $$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Delete duplicate chains replacing their references
|
# Compare two chains. Sort in reverse order except within names that have the
|
||||||
|
# same first character, which are sorted in forward order.
|
||||||
#
|
#
|
||||||
sub level8_compare( $$ ) {
|
sub level8_compare( $$ ) {
|
||||||
my ( $name1, $name2 ) = ( $_[0]->{name}, $_[1]->{name} );
|
my ( $name1, $name2 ) = ( $_[0]->{name}, $_[1]->{name} );
|
||||||
|
|
||||||
if ( $name1 =~ /^%/ && $name2 =~ /^%/ ) {
|
if ( substr( $name1, 0, 1 ) eq substr( $name2, 0, 1 ) ) {
|
||||||
$name1 cmp $name2;
|
$name1 cmp $name2;
|
||||||
} else {
|
} else {
|
||||||
$name2 cmp $name1;
|
$name2 cmp $name1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Delete duplicate chains replacing their references
|
||||||
|
#
|
||||||
sub optimize_level8( $$$ ) {
|
sub optimize_level8( $$$ ) {
|
||||||
my ( $table, $tableref , $passes ) = @_;
|
my ( $table, $tableref , $passes ) = @_;
|
||||||
my $progress = 1;
|
my $progress = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user