Bug 10851: (follow-up) fix issues reported by QA script
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 21 Jan 2014 08:28:24 +0000 (09:28 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 4 Feb 2014 17:48:37 +0000 (17:48 +0000)
This patch fixes following warnings:

 FAIL   C4/Serials.pm
   FAIL   valid
        Useless use of a constant (43) in void context
        Useless use of a constant (41) in void context
        Useless use of a constant (44) in void context
        Useless use of a constant (42) in void context
        Useless use of a constant (4) in void context

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Serials.pm

index e745458..2fb639b 100644 (file)
@@ -425,7 +425,7 @@ sub PrepareSerialsData {
             }
         }
         $subs->{ "status" . $subs->{'status'} } = 1;
-        if ( grep { $_ == $subs->{status} } ( 1, 3, 4, 41, 42, 43, 44, 7 ) ) {
+        if ( grep { $_ == $subs->{status} } qw( 1 3 4 41 42 43 44 7 ) ) {
             $subs->{"checked"} = 1;
         }
 
@@ -1250,10 +1250,11 @@ sub ModSerialStatus {
             if ( $status == 2 || ($oldstatus == 2 && $status != 2) ) {
                   _update_receivedlist($subscriptionid);
             }
-            if(  grep { $_ == $status } ( 4, 41, 42, 43, 44, 5 )
+            my @missing_statuses = qw( 4 41 42 43 44 );
+            if ( (  grep { $_ == $status } ( @missing_statuses, 5 ) )
               || (
-                  grep { $_ == $oldstatus } ( 4, 41, 42, 43, 44 )
-                  && ! grep { $_ == $status } ( 4, 41, 42, 43, 44 ) )
+                  ( grep { $_ == $oldstatus } @missing_statuses )
+                  && ! ( grep { $_ == $status } @missing_statuses ) )
               || ($oldstatus == 5 && $status != 5)) {
                 _update_missinglist($subscriptionid);
             }