[systeminfo] Use the existing ChannelUID instance to check the linked state (#16553)

Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
joerg1985 2024-03-21 22:15:34 +01:00 committed by Ciprian Pascu
parent e8cff07721
commit 6d5b9668bc

View File

@ -18,7 +18,6 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -403,10 +402,8 @@ public class SysteminfoHandler extends BaseThingHandler {
if (!ThingStatus.ONLINE.equals(thing.getStatus())) {
return;
}
Iterator<ChannelUID> iter = channels.iterator();
while (iter.hasNext()) {
ChannelUID channeUID = iter.next();
if (isLinked(channeUID.getId())) {
for (ChannelUID channeUID : channels) {
if (isLinked(channeUID)) {
publishDataForChannel(channeUID);
}
}