Commits

shlomif_rsip  committed c968d1f

Refactoring: get rid of @cmt .

  • Participants
  • Parent commits f2cd032

Comments (0)

Files changed (1)

File config-inifiles/lib/Config/IniFiles.pm

     no strict 'refs';
     my ($self, $fh, $delta) = @_;
 
-    my (@cmts);
     my $ors = $self->{line_ends} || $\ || "\n"; # $\ is normally unset, but use input by default
     my $notfirst = 0;
     local $_;
         next SECT unless defined $self->{v}{$sect};
         print {$fh} $ors if $notfirst;
         $notfirst = 1;
-        if ((ref($self->{sCMT}{$sect}) eq 'ARRAY') &&
-            (@cmts = @{$self->{sCMT}{$sect}})) {
-            foreach (@cmts) {
-                print {$fh} "$_$ors";
+        if (ref($self->{sCMT}{$sect}) eq 'ARRAY') {
+            foreach my $comment (@{$self->{sCMT}{$sect}}) {
+                print {$fh} "$comment$ors";
             }
         }
 
                 }
                 next PARM;
             }
-            if ((ref($self->{pCMT}{$sect}{$parm}) eq 'ARRAY') &&
-                (@cmts = @{$self->{pCMT}{$sect}{$parm}})) {
-                foreach (@cmts) {
-                    print {$fh} "$_$ors";
+            if (ref($self->{pCMT}{$sect}{$parm}) eq 'ARRAY') {
+                foreach my $comment (@{$self->{pCMT}{$sect}{$parm}}) {
+                    print {$fh} "$comment$ors";
                 }
             }