fhem.pl: optimize Dispatch (Forum #125292)

git-svn-id: https://svn.fhem.de/fhem/trunk@25456 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2022-01-11 15:32:01 +00:00
parent aa63a7a901
commit 2e37380540

View File

@@ -4108,6 +4108,7 @@ Dispatch($$;$$)
$h = $module->{MatchList} if(!$h);
if(defined($h)) {
foreach my $m (sort keys %{$h}) {
next if($modules{$m}{LOADED}); # checked in the loop above, #125292
if($dmsg =~ m/$h->{$m}/s) {
my ($order, $mname) = split(":", $m);
@@ -4129,6 +4130,7 @@ Dispatch($$;$$)
last;
}
}
delete($hash->{".clientArray"});
} else {
Log 0, "ERROR: Cannot autoload $mname";
@@ -4140,7 +4142,6 @@ Dispatch($$;$$)
return undef;
}
delete($hash->{".clientArray"});
}
}
}