Add test for range reversal in isBetween and refactor isBetween.

This commit is contained in:
Colin Kuskie 2005-12-11 03:49:44 +00:00
parent d8b8d9b68d
commit 1d5ab960ee
2 changed files with 2 additions and 3 deletions

View file

@ -125,9 +125,7 @@ sub isBetween {
my $first = shift;
my $second = shift;
if ($first > $second) {
my $temp = $first;
$first = $second;
$second = $temp;
($first,$second) = ($second,$first);
}
if ($value >= $first && $value <= $second) {
return 1;