Reduce the size of many configs by not copying long chains multiple times.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep
2011-12-30 10:27:58 -08:00
parent eb15d0411f
commit c635cc9c9e

View File

@@ -2780,7 +2780,7 @@ sub optimize_level4( $$ ) {
# Last rule is a simple branch
my $targetref = $tableref->{$lastrule->{target}};
if ( $targetref && ! ( $targetref->{builtin} || $targetref->{dont_move} ) ) {
if ( $targetref && ! ( $targetref->{builtin} || $targetref->{dont_move} ) && ( keys %{$targetref->{references}} < 2 || @{$targetref->{rules}} < 4 ) ) {
copy_rules( $targetref, $chainref );
$progress = 1;
}