Bug 11797: (follow-up) fix MARC21 branch of bug more idiomatically
authorGalen Charlton <gmc@esilibrary.com>
Tue, 15 Apr 2014 15:16:42 +0000 (15:16 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 15 Apr 2014 16:01:31 +0000 (16:01 +0000)
This patch puts the MARC21 variant of the bugfix in alignment
with the UNIMARC variant, removing the use of unnecessary
temporary variables.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/AuthoritiesMarc.pm

index 0353142..8bcddbc 100644 (file)
@@ -1044,17 +1044,15 @@ sub BuildSummary {
                 $subfields_to_report = 'vxyz';
             }
             if ($subfields_to_report) {
-                my $hemain = $field->subfield( substr($subfields_to_report, 0, 1) );
                 push @authorized, {
                     heading => $field->as_string($subfields_to_report),
-                    hemain  => $hemain,
+                    hemain  => ( $field->subfield( substr($subfields_to_report, 0, 1) ) // undef ),
                     field   => $tag,
                 };
             } else {
-                my $hemain = $field->subfield( 'a' );
                 push @authorized, {
                     heading => $field->as_string(),
-                    hemain  => $hemain,
+                    hemain  => ( $field->subfield( 'a' ) // undef ),
                     field   => $tag,
                 };
             }