From ae35516c0533e8b6a7bb86f953793f16cd60c779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Fri, 12 Jul 2024 16:01:02 +0200 Subject: [PATCH] LibreQoS.py - code optymalisation, if first test is ok, dont next because its useless (the device is marked as deviceChanged allready) --- src/LibreQoS.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/LibreQoS.py b/src/LibreQoS.py index 8f492cb92..6b75a2765 100755 --- a/src/LibreQoS.py +++ b/src/LibreQoS.py @@ -1089,18 +1089,13 @@ def refreshShapersUpdateOnly(): for circuitID, circuit in lastLoadedSubscriberCircuitsByID.items(): if (circuitID in newlyUpdatedSubscriberCircuitsByID) and (circuitID in lastLoadedSubscriberCircuitsByID): - if newlyUpdatedSubscriberCircuitsByID[circuitID]['maxDownload'] != lastLoadedSubscriberCircuitsByID[circuitID]['maxDownload']: - devicesChanged = True - if newlyUpdatedSubscriberCircuitsByID[circuitID]['maxUpload'] != lastLoadedSubscriberCircuitsByID[circuitID]['maxUpload']: - devicesChanged = True - if newlyUpdatedSubscriberCircuitsByID[circuitID]['minDownload'] != lastLoadedSubscriberCircuitsByID[circuitID]['minDownload']: - devicesChanged = True - if newlyUpdatedSubscriberCircuitsByID[circuitID]['minUpload'] != lastLoadedSubscriberCircuitsByID[circuitID]['minUpload']: - devicesChanged = True - if newlyUpdatedSubscriberCircuitsByID[circuitID]['devices'] != lastLoadedSubscriberCircuitsByID[circuitID]['devices']: - devicesChanged = True - if newlyUpdatedSubscriberCircuitsByID[circuitID]['ParentNode'] != lastLoadedSubscriberCircuitsByID[circuitID]['ParentNode']: - devicesChanged = True + if ((newlyUpdatedSubscriberCircuitsByID[circuitID]['maxDownload'] != lastLoadedSubscriberCircuitsByID[circuitID]['maxDownload']) + or (newlyUpdatedSubscriberCircuitsByID[circuitID]['maxUpload'] != lastLoadedSubscriberCircuitsByID[circuitID]['maxUpload']) + or (newlyUpdatedSubscriberCircuitsByID[circuitID]['minDownload'] != lastLoadedSubscriberCircuitsByID[circuitID]['minDownload']) + or (newlyUpdatedSubscriberCircuitsByID[circuitID]['minUpload'] != lastLoadedSubscriberCircuitsByID[circuitID]['minUpload']) + or (newlyUpdatedSubscriberCircuitsByID[circuitID]['devices'] != lastLoadedSubscriberCircuitsByID[circuitID]['devices']) + or (newlyUpdatedSubscriberCircuitsByID[circuitID]['ParentNode'] != lastLoadedSubscriberCircuitsByID[circuitID]['ParentNode'])): + devicesChanged = True else: devicesChanged = True for circuitID, circuit in newlyUpdatedSubscriberCircuitsByID.items():