Favor low-numbered less complex synonym chains in optimization 8.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-01-25 13:55:04 -08:00
parent c958329d14
commit b7273d6999

View File

@ -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;