Add test for range reversal in isBetween and refactor isBetween.
This commit is contained in:
parent
d8b8d9b68d
commit
1d5ab960ee
2 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue