Use direct initialisation
For consistency across the file. This is cleaner.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
Change-Id: I93845cf37ecaff15eb687082c32b5fd471356639
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index 12adad2..be9d78a 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -303,8 +303,7 @@
if (!sensorType.empty() && !name.empty())
{
- std::string objPath(sensorDbusPath);
- objPath += sensorType + "/" + name;
+ auto objPath = sensorDbusPath + sensorType + "/" + name;
auto paramPtr =
std::make_unique<SensorParam>(bus, objPath, this);
@@ -785,8 +784,7 @@
entry("TYPE=%s", name.c_str()));
continue;
}
- std::string objPath(sensorDbusPath);
- objPath += sensorType + "/" + name;
+ auto objPath = sensorDbusPath + sensorType + "/" + name;
auto virtualSensorPtr = std::make_unique<VirtualSensor>(
bus, objPath.c_str(), j, name);