diff --git a/include/cpu.hpp b/include/cpu.hpp index 9154a22..bf8f5fd 100644 --- a/include/cpu.hpp +++ b/include/cpu.hpp @@ -23,7 +23,7 @@ struct cpuSensors { uint32_t avg_freq = 0; }; -void detectHwmon(cpuSensors* target, std::string pci); +void detectHwmon(cpuSensors* target, const std::string& pci); void update(cpuSensors* g); } // namespace cpu diff --git a/include/gpu.hpp b/include/gpu.hpp index 1821f78..428407a 100644 --- a/include/gpu.hpp +++ b/include/gpu.hpp @@ -43,7 +43,7 @@ struct gpuSensors { // uint64_t vram_total = 0; }; -void detectHwmon(gpuSensors* target, std::string pci); +void detectHwmon(gpuSensors* target, const std::string& pci); void update(gpuSensors* g); } // namespace gpu diff --git a/src/cpu.cpp b/src/cpu.cpp index ee81f78..a69c1b6 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -7,7 +7,7 @@ namespace cpu { -void detectHwmon(cpuSensors* target, std::string pci) { +void detectHwmon(cpuSensors* target, const std::string& pci) { std::string path = "/sys/bus/pci/devices/" + pci + "/hwmon"; try { diff --git a/src/gpu.cpp b/src/gpu.cpp index 587b291..64db35f 100644 --- a/src/gpu.cpp +++ b/src/gpu.cpp @@ -10,7 +10,7 @@ namespace gpu { /* takes pointer to a target gpu::sensors struct and updates its hwmon path and detects gpu_metrics */ -void detectHwmon(gpuSensors* target, std::string pci) { +void detectHwmon(gpuSensors* target, const std::string& pci) { target->hwmon = getFirstDir("/sys/bus/pci/devices/" + pci + "/hwmon"); log(LOG::INF, "gpu::detectHwmon", "Detected path \"{}\"", target->hwmon);