diff options
author | Yorhel <git@yorhel.nl> | 2012-07-06 13:02:03 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2012-07-06 13:13:22 +0200 |
commit | b017974cc80c2e3775fd52631854dc92a9aeab93 (patch) | |
tree | ff387b1f6f1f239f0a315d50f7d8adbfb81357d9 /lib/VNDB/Handler/VNPage.pm | |
parent | 49d071da55e931b3f47e1d24f9131d360b42d476 (diff) |
Handler::VNPage: Compare booleans after negation in releases table
This fixes another (obscure) Perl warning when $rel->{patch} is undef.
Perl similar to C when it comes to booleans: Comparing them with == is a
recipe for disaster. (Unless you use the C99 'bool' type, but Perl
doesn't have such an equivalent)
Diffstat (limited to 'lib/VNDB/Handler/VNPage.pm')
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index 71c62602..f1b4376d 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -301,11 +301,11 @@ sub _compare_rel { return 1; } elsif ($variable eq 'type') { $last_rel->{type} eq $rel->{type} && - $last_rel->{patch} == $rel->{patch} + !$last_rel->{patch} == !$rel->{patch} } elsif ($variable eq 'publication') { - $last_rel->{patch} == $rel->{patch} && - $last_rel->{freeware} == $rel->{freeware} && - $last_rel->{doujin} == $rel->{doujin} + !$last_rel->{patch} == !$rel->{patch} && + !$last_rel->{freeware}== !$rel->{freeware} && + !$last_rel->{doujin} == !$rel->{doujin} } elsif ($variable eq 'notes') { $last_rel->{notes} eq $rel->{notes}; } else { |