Fix clazy warnings regarding range-for references
[pulseview.git] / pv / widgets / devicetoolbutton.cpp
index 99335ca18c3afebe2145a19193f94db1d24eddc6..6a12aa25c446904651b60bfe6de58e13d27eaa12 100644 (file)
@@ -91,7 +91,7 @@ void DeviceToolButton::update_device_list()
        menu_.setDefaultAction(connect_action_);
        menu_.addSeparator();
 
-       for (weak_ptr<Device> dev_weak_ptr : devices_) {
+       for (weak_ptr<Device>& dev_weak_ptr : devices_) {
                shared_ptr<Device> dev(dev_weak_ptr.lock());
                if (!dev)
                        continue;
@@ -117,7 +117,7 @@ void DeviceToolButton::on_action(QObject *action)
        selected_device_.reset();
 
        Device *const dev = (Device*)((QAction*)action)->data().value<void*>();
-       for (weak_ptr<Device> dev_weak_ptr : devices_) {
+       for (weak_ptr<Device>& dev_weak_ptr : devices_) {
                shared_ptr<Device> dev_ptr(dev_weak_ptr);
                if (dev_ptr.get() == dev) {
                        selected_device_ = shared_ptr<Device>(dev_ptr);
@@ -157,5 +157,5 @@ void DeviceToolButton::on_menu_hover_timeout()
        QToolTip::showText(QCursor::pos(), device_tooltip_);
 }
 
-} // widgets
-} // pv
+}  // namespace widgets
+}  // namespace pv