PerformScan: Reorder operations when processing old configuration

recordDiscoveredIdentifiers() doesn't modify the record held in
*fromLastJson, so move it to below pruneRecordExposes() to implement a
logical flow of operations.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I516e4afa365a218a9042ccdb01e0fa62872a6529
diff --git a/src/PerformScan.cpp b/src/PerformScan.cpp
index 9c621a0..4203cd7 100644
--- a/src/PerformScan.cpp
+++ b/src/PerformScan.cpp
@@ -373,6 +373,9 @@
 
                     pruneRecordExposes(*fromLastJson);
 
+                    recordDiscoveredIdentifiers(usedNames, indexes, probeName,
+                                                *fromLastJson);
+
                     // keep user changes
                     _systemConfiguration[recordName] = *fromLastJson;
                     _missingConfigurations.erase(recordName);
@@ -380,9 +383,6 @@
                     // We've processed the device, remove it and advance the
                     // iterator
                     itr = foundDevices.erase(itr);
-
-                    recordDiscoveredIdentifiers(usedNames, indexes, probeName,
-                                                *fromLastJson);
                 }
 
                 std::optional<std::string> replaceStr;