From 787a1867a030182f4d942adaa2f408fbde43d7c2 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 17 Aug 2009 12:58:50 -0700 Subject: [PATCH] Another tiny performance enhancement --- Shorewall/Perl/Shorewall/Accounting.pm | 2 +- Shorewall/Perl/Shorewall/Chains.pm | 5 +++-- Shorewall/Perl/Shorewall/Compiler.pm | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Accounting.pm b/Shorewall/Perl/Shorewall/Accounting.pm index 0ef3c822b..21e60943c 100644 --- a/Shorewall/Perl/Shorewall/Accounting.pm +++ b/Shorewall/Perl/Shorewall/Accounting.pm @@ -38,7 +38,7 @@ our @EXPORT_OK = qw( ); our $VERSION = '4.3_7'; # -# Called by the compiler +# Called by the compiler to [re-]initialize this module's state # sub initialize() { our $jumpchainref; diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 83d91e2e1..8cb80403f 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -414,10 +414,11 @@ sub decr_cmd_level( $ ) { # sub add_commands ( $$;@ ) { - my $chainref = shift @_; + my $chainref = shift @_; + my $indentation = ' ' x $chainref->{cmdlevel}; for ( @_ ) { - push @{$chainref->{rules}}, join ('', ' ' x $chainref->{cmdlevel} , $_ ); + push @{$chainref->{rules}}, join ('', $indentation , $_ ); } $chainref->{referenced} = 1; diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index 5e50cf4f1..32c08c906 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -571,7 +571,7 @@ sub compiler { } # - # Now that we know the address family that we are dealing with (IPv4/IPv6), we can initialize the other modules' globals + # Now that we know the address family (IPv4/IPv6), we can initialize the other modules' globals # initialize_package_globals;