From d6369b1f946980f0e22fc18da3fc54a14501b3c5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 18 May 2009 13:07:33 +0000 Subject: [PATCH] =?utf8?q?List::MoreUtils=20f=C3=BCr=20kompakteren=20Code?= =?utf8?q?=20benutzen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IC.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index fdeecc473..5314d4b8e 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -35,6 +35,7 @@ package IC; use Data::Dumper; +use List::MoreUtils qw(all); use YAML; use SL::DBUtils; @@ -343,11 +344,7 @@ sub save { # Check whether or not the prices have changed. If they haven't # then 'priceupdate' should not be updated. my $previous_values = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM parts WHERE id = ?|, conv_i($form->{id})) || {}; - if ( ($previous_values->{sellprice} == $form->{sellprice}) - && ($previous_values->{lastcost} == $form->{lastcost}) - && ($previous_values->{listprice} == $form->{listprice})) { - $priceupdate = ''; - } + $priceupdate = '' if (all { $previous_values->{$_} == $form->{$_} } qw(sellprice lastcost listprice)); } else { my ($count) = selectrow_query($form, $dbh, qq|SELECT COUNT(*) FROM parts WHERE partnumber = ?|, $form->{partnumber}); -- 2.20.1