From dca5c09d9c0d8afade3edad2a8b178ac40cc9a78 Mon Sep 17 00:00:00 2001 From: Rob Emery Date: Sun, 10 Aug 2014 22:31:54 +0100 Subject: [PATCH] WeekdaysBetween: Minor bit of tidying up --- lib/DDG/Goodie/WeekdaysBetween.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/DDG/Goodie/WeekdaysBetween.pm b/lib/DDG/Goodie/WeekdaysBetween.pm index 17f9e3bb4..e7b1779d7 100755 --- a/lib/DDG/Goodie/WeekdaysBetween.pm +++ b/lib/DDG/Goodie/WeekdaysBetween.pm @@ -59,16 +59,10 @@ sub delta_weekdays { $dow2 -= 7 if($dow2 > 7); for(;;) { - if($dow1 < 6) { - $result = $result + 1; - } - if($dow1 == $dow2) { - last; - } + $result = $result + 1 if($dow1 < 6); + last if($dow1 == $dow2); $dow1 = $dow1 + 1; - if($dow1 > 7) { - $dow1 = $dow1 - 7; - } + $dow1 = $dow1 - 7 if($dow1 > 7); } return $result;