[Koha-bugs] [Bug 12151] remove remaining uses of the Perl smartmatch operator

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jun 11 13:06:54 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12151

--- Comment #7 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Comment on attachment 28580
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28580
Bug 12151: Remove uses of smartmatch operator in Search.pm and opac-search.pl

Review of attachment 28580:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=12151&attachment=28580)
-----------------------------------------------------------------

::: C4/Search.pm
@@ +533,4 @@
>                                  foreach my $field (@fields) {
>                                      my $data = $field->as_string( $subfield_letters, $facet->{sep} );
>  
> +                                    unless ( any { $data eq $_ } @used_datas ) {

Why don't you use grep?
  unless( grep /^$date$/, @used_datas )

Should do the same without the List::MoreUtils deps.

::: opac/opac-search.pl
@@ +358,4 @@
>  @sort_by = $cgi->param('sort_by');
>  $sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
>  foreach my $sort (@sort_by) {
> +    if ( any { $sort eq $_ } @allowed_sortby ) {

Same here.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list