From 980a43b097489a68f8b49125b2258eb2697e313e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 20 Jun 2010 14:40:33 +0100 Subject: [PATCH] No need to return $i from warnings::__chk, as the value is not used. $i holds the depth of the caller frame from which the warnings bitmask is read. The value has not been used by any caller of __chk() since c3186b657097c822. --- lib/warnings.pm | 10 +++++----- warnings.pl | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/warnings.pm b/lib/warnings.pm index ef91ff6..837718c 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -453,7 +453,7 @@ sub __chk # Defaulting this to 0 reduces complexity in code paths below. my $callers_bitmask = (caller($i))[9] || 0 ; - return ($callers_bitmask, $offset, $i) ; + return ($callers_bitmask, $offset) ; } sub _error_loc { @@ -466,7 +466,7 @@ sub enabled Croaker("Usage: warnings::enabled([category])") unless @_ == 1 || @_ == 0 ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; return vec($callers_bitmask, $offset, 1) || vec($callers_bitmask, $Offsets{'all'}, 1) ; @@ -477,7 +477,7 @@ sub fatal_enabled Croaker("Usage: warnings::fatal_enabled([category])") unless @_ == 1 || @_ == 0 ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; return vec($callers_bitmask, $offset + 1, 1) || vec($callers_bitmask, $Offsets{'all'} + 1, 1) ; @@ -489,7 +489,7 @@ sub warn unless @_ == 2 || @_ == 1 ; my $message = pop ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; require Carp; Carp::croak($message) if vec($callers_bitmask, $offset+1, 1) || @@ -503,7 +503,7 @@ sub warnif unless @_ == 2 || @_ == 1 ; my $message = pop ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; return unless (vec($callers_bitmask, $offset, 1) || diff --git a/warnings.pl b/warnings.pl index 25dd302..4c2c3bb 100644 --- a/warnings.pl +++ b/warnings.pl @@ -738,7 +738,7 @@ sub __chk # Defaulting this to 0 reduces complexity in code paths below. my $callers_bitmask = (caller($i))[9] || 0 ; - return ($callers_bitmask, $offset, $i) ; + return ($callers_bitmask, $offset) ; } sub _error_loc { @@ -751,7 +751,7 @@ sub enabled Croaker("Usage: warnings::enabled([category])") unless @_ == 1 || @_ == 0 ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; return vec($callers_bitmask, $offset, 1) || vec($callers_bitmask, $Offsets{'all'}, 1) ; @@ -762,7 +762,7 @@ sub fatal_enabled Croaker("Usage: warnings::fatal_enabled([category])") unless @_ == 1 || @_ == 0 ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; return vec($callers_bitmask, $offset + 1, 1) || vec($callers_bitmask, $Offsets{'all'} + 1, 1) ; @@ -774,7 +774,7 @@ sub warn unless @_ == 2 || @_ == 1 ; my $message = pop ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; require Carp; Carp::croak($message) if vec($callers_bitmask, $offset+1, 1) || @@ -788,7 +788,7 @@ sub warnif unless @_ == 2 || @_ == 1 ; my $message = pop ; - my ($callers_bitmask, $offset, $i) = __chk(@_) ; + my ($callers_bitmask, $offset) = __chk(@_) ; return unless (vec($callers_bitmask, $offset, 1) || -- 2.7.4