mainloop: delete unused local empty pointer instances

Delete local variables that are not used.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I1e805ac7d474ac9b2bc4dd89ec4a9b166bf067a2
diff --git a/mainloop.cpp b/mainloop.cpp
index 6908d78..ab4af2e 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -415,18 +415,16 @@
 
                 for (auto& iface : obj)
                 {
-                    auto valueIface = std::shared_ptr<ValueObject>();
-                    auto warnIface = std::shared_ptr<WarningObject>();
-                    auto critIface = std::shared_ptr<CriticalObject>();
-
                     switch (iface.first)
                     {
                         case InterfaceType::VALUE:
-                            valueIface =
-                                std::any_cast<std::shared_ptr<ValueObject>>(
+                        {
+                            auto& valueIface =
+                                std::any_cast<std::shared_ptr<ValueObject>&>(
                                     iface.second);
                             valueIface->value(value);
-                            break;
+                        }
+                        break;
                         case InterfaceType::WARN:
                             checkThresholds<WarningObject>(iface.second, value);
                             break;