2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

FHEMWEB: speedup for sortRooms (Forum #23921)

git-svn-id: https://svn.fhem.de/fhem/trunk@5974 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-05-26 12:14:15 +00:00
parent 50bebc2908
commit 2888758e5a

View File

@ -1087,8 +1087,9 @@ FW_roomOverview($)
my @rlist;
if(AttrVal($FW_wname, "sortRooms", "")) { # Slow!
my @sortBy = split( " ", AttrVal( $FW_wname, "sortRooms", "" ) );
@rlist = sort { FW_roomIdx(@sortBy,$a) cmp
FW_roomIdx(@sortBy,$b) } keys %FW_rooms;
my %sHash;
map { $sHash{$_} = FW_roomIdx(@sortBy,$_) } keys %FW_rooms;
@rlist = sort { $sHash{$a} cmp $sHash{$b} } keys %FW_rooms;
} else {
@rlist = sort keys %FW_rooms;