Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

checks for empty answers made a bit more concise

  • Loading branch information...
commit 9aa68f6fb9bbef2b0ca82537ff4efac44f4c2a3d 1 parent d2b9541
@wchristian wchristian authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/Net/LastFMAPI.pm
View
6 lib/Net/LastFMAPI.pm
@@ -318,10 +318,8 @@ sub extract_rows {
my @data_keys = sort keys %{$main_data};
unless (@main_keys == 1 && @data_keys == 2 && $data_keys[0] eq '@attr') {
carp "extracting rows may be broken";
- if (defined $main_data->{'#text'} && $main_data->{'#text'} =~ /^\s+$/
- && defined $main_data->{total} && $main_data->{total} == 0) { # no rows
- return ();
- };
+ my ( $text, $total ) = ( $main_data->{'#text'}, $main_data->{total} );
+ return if defined $text && $text =~ /^\s+$/ && defined $total && $total == 0; # no rows
}
%last_response_meta = %{ $main_data->{$data_keys[0]} };
my $rows = $main_data->{$data_keys[1]};
Please sign in to comment.
Something went wrong with that request. Please try again.