WeekdaysBetween: Minor bit of tidying up

master
Rob Emery 2014-08-10 22:31:54 +01:00
parent 634431f036
commit dca5c09d9c
1 changed files with 3 additions and 9 deletions

View File

@ -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;