Bugzilla – Attachment 32771 Details for
Bug 12573
blinddetail-biblio-search uses wrong comparison operator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12573: Use correct comparison for comparing strings
PASSED-QA-Bug-12573-Use-correct-comparison-for-com.patch (text/plain), 1.75 KB, created by
Katrin Fischer
on 2014-10-26 10:40:03 UTC
(
hide
)
Description:
[PASSED QA] Bug 12573: Use correct comparison for comparing strings
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-10-26 10:40:03 UTC
Size:
1.75 KB
patch
obsolete
>From 3fe26277a332dfea1bda145e86c4f64aceeeff3d Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 14 Jul 2014 16:28:27 +0100 >Subject: [PATCH] [PASSED QA] Bug 12573: Use correct comparison for comparing > strings > >Perl issues a warning when you try to do a numeric comparison on >non numeric values. While in 99% of the caeses numeric and string >comparison behave similarly when they dont tracking down resulting >bugs is hard. Also we dont want to be logging errors for normal >operations. replace numeric == with eq >(also switched to non-interpolating quotes so we dont generate >a warning from static code checkers like perlcritic) > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> > >I can get this warnings in log files. This patch make perfectly sense. >MARC subfield code should never be tested with Perl == operator, since >the code could be letter or a number. Perl eq operator do an implicit >string conversion for value which is a number, so it will work in any >case. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > authorities/blinddetail-biblio-search.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl >index a196396..d0f4069 100755 >--- a/authorities/blinddetail-biblio-search.pl >+++ b/authorities/blinddetail-biblio-search.pl >@@ -86,7 +86,7 @@ if ($authid) { > # Get all values for each distinct subfield > my %subfields; > for ( $field->subfields ) { >- next if $_->[0] == "9"; # $9 will be set with authid value >+ next if $_->[0] eq '9'; # $9 will be set with authid value > my $letter = $_->[0]; > next if defined $subfields{$letter}; > my @values = $field->subfield($letter); >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12573
:
29683
|
32769
| 32771