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/PSUSensor.cpp b/src/PSUSensor.cpp
index 5a3ecc2..25cc5ad 100644
--- a/src/PSUSensor.cpp
+++ b/src/PSUSensor.cpp
@@ -103,7 +103,7 @@
if (auto fileParts = splitFileName(path))
{
- auto [type, nr, item] = *fileParts;
+ auto& [type, nr, item] = *fileParts;
if (item.compare("input") == 0)
{
pathRatedMax = boost::replace_all_copy(path, item, "rated_max");