mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
99_Utils.pm: make min/max declaration "standard" compatible (Forum #120021)
git-svn-id: https://svn.fhem.de/fhem/trunk@24128 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ad8061392f
commit
dcf7599d9f
@ -22,9 +22,10 @@ time_str2num($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
min($@)
|
min(@)
|
||||||
{
|
{
|
||||||
my ($min, @vars) = @_;
|
my ($min, @vars) = @_;
|
||||||
|
return $min if(!defined($min));
|
||||||
for (@vars) {
|
for (@vars) {
|
||||||
$min = $_ if $_ lt $min;
|
$min = $_ if $_ lt $min;
|
||||||
}
|
}
|
||||||
@ -32,9 +33,10 @@ min($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
max($@)
|
max(@)
|
||||||
{
|
{
|
||||||
my ($max, @vars) = @_;
|
my ($max, @vars) = @_;
|
||||||
|
return $max if(!defined($max));
|
||||||
for (@vars) {
|
for (@vars) {
|
||||||
$max = $_ if $_ gt $max;
|
$max = $_ if $_ gt $max;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user