use pointers to strings

This commit is contained in:
2025-12-14 15:14:23 +01:00
parent e5e123f6f8
commit fbf2a64684
4 changed files with 4 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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);