NVMeSensorMain: Make early exits contiguous
This makes for a clear pattern of behaviour.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ie9b74e384d7a6a5c0c4a7a9d2466e2b292a33497
diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index fe4fb5b..2e29eaf 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -167,6 +167,12 @@
continue;
}
+ std::optional<int> rootBus = deriveRootBus(busNumber);
+ if (!rootBus)
+ {
+ continue;
+ }
+
std::vector<thresholds::Threshold> sensorThresholds;
if (!parseThresholdsFromConfig(sensorData, sensorThresholds))
{
@@ -174,12 +180,6 @@
<< "\n";
}
- std::optional<int> rootBus = deriveRootBus(busNumber);
- if (!rootBus)
- {
- continue;
- }
-
std::shared_ptr<NVMeSensor> sensorPtr = std::make_shared<NVMeSensor>(
objectServer, io, dbusConnection, *sensorName,
std::move(sensorThresholds), interfacePath, *busNumber);