expression: limit JSON value copy
Switch 'auto' to 'auto&' to minimize the unnecessary JSON object copy.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If2f89f1b7a895051f1fc240d8199b721788509ec
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index 5883d23..304e874 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -292,7 +292,7 @@
static constexpr auto exprKey = "Expression";
if (sensorConfig.contains(exprKey))
{
- auto ref = sensorConfig.at(exprKey);
+ auto& ref = sensorConfig.at(exprKey);
if (ref.is_array())
{
exprStr = std::string{};