]> sigrok.org Git - pulseview.git/commitdiff
Enum: Use an iterator instead of iterating by indexes
authorJoel Holdsworth <redacted>
Wed, 12 Mar 2014 20:34:37 +0000 (21:34 +0100)
committerJoel Holdsworth <redacted>
Thu, 13 Mar 2014 17:00:33 +0000 (17:00 +0000)
pv/prop/enum.cpp

index 9044c6bae9d3c6335589c26e7be65835186a7b81..71cd431548da771ff5e3a9289480f62c5d5b71d2 100644 (file)
@@ -41,8 +41,9 @@ Enum::Enum(QString name,
 
 Enum::~Enum()
 {
-       for (unsigned int i = 0; i < _values.size(); i++)
-               g_variant_unref(_values[i].first);
+       for (vector< pair<GVariant*, QString> >::const_iterator i =
+               _values.begin(); i != _values.end(); i++)
+               g_variant_unref((*i).first);
 }
 
 QWidget* Enum::get_widget(QWidget *parent, bool auto_commit)