Some tiding of warnings::__chk().
authorNicholas Clark <nick@ccl4.org>
Sat, 6 Feb 2010 18:16:57 +0000 (18:16 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 23 Jun 2010 07:33:17 +0000 (08:33 +0100)
Remove my $this_pkg, rendered unused by 4f527b719ae89076. Move $pkg inside the
if() block. Don't needlessly assign to $i.

lib/warnings.pm
warnings.pl

index defc208..10a7cbf 100644 (file)
@@ -458,11 +458,11 @@ sub __chk
            unless defined $offset ;
     }
 
-    my $this_pkg = (caller(1))[0] ;
-    my $i = 2 ;
-    my $pkg ;
+    my $i;
 
     if ($isobj) {
+        my $pkg;
+        $i = 2;
         while (do { { package DB; $pkg = (caller($i++))[0] } } ) {
             last unless @DB::args && $DB::args[0] =~ /^$category=/ ;
         }
index 514ccd7..59d8652 100644 (file)
@@ -743,11 +743,11 @@ sub __chk
            unless defined $offset ;
     }
 
-    my $this_pkg = (caller(1))[0] ;
-    my $i = 2 ;
-    my $pkg ;
+    my $i;
 
     if ($isobj) {
+        my $pkg;
+        $i = 2;
         while (do { { package DB; $pkg = (caller($i++))[0] } } ) {
             last unless @DB::args && $DB::args[0] =~ /^$category=/ ;
         }