Using reference to avoid copy
With this commit a reference will be used during some structure
binding to avoid copies.
Tested:
CPUSensors and PSUSensors launched on physical machine, no
regression detected.
Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
Change-Id: I7aa270e440e9aadeca151acc6d9b73d7c4c4f40c
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
index 2261af7..dfc942f 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
@@ -312,7 +312,7 @@
{
continue;
}
- auto [type, nr, item] = *fileParts;
+ auto& [type, nr, item] = *fileParts;
auto inputPathStr = inputPath.string();
auto labelPath =
boost::replace_all_copy(inputPathStr, item, "label");