PerformScan: Promote recordPtr to reference
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I3af46421c62601f68ef30a6883255f11ce14eeff
diff --git a/src/PerformScan.cpp b/src/PerformScan.cpp
index 1c71267..9ea8e27 100644
--- a/src/PerformScan.cpp
+++ b/src/PerformScan.cpp
@@ -496,7 +496,7 @@
continue;
}
- nlohmann::json* recordPtr = &(*it);
+ nlohmann::json& recordRef = *it;
nlohmann::json probeCommand;
if ((*findProbe).type() != nlohmann::json::value_t::array)
{
@@ -513,7 +513,7 @@
auto thisRef = shared_from_this();
auto probePointer = std::make_shared<PerformProbe>(
probeCommand, thisRef,
- [&, recordPtr,
+ [&, recordRef,
probeName](FoundDevices& foundDevices,
const MapperGetSubTreeResponse& dbusSubtree) {
_passed = true;
@@ -570,7 +570,7 @@
(objectIt == dbusSubtree.end()) ? emptyObject
: objectIt->second;
- nlohmann::json record = *recordPtr;
+ nlohmann::json record = recordRef;
std::string recordName =
getRecordName(foundDevice, probeName);
size_t foundDeviceIdx = indexes.front();