From: Joel Holdsworth Date: Wed, 12 Mar 2014 20:34:37 +0000 (+0100) Subject: Enum: Use an iterator instead of iterating by indexes X-Git-Tag: pulseview-0.2.0~21 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1e5faac3a34145620fedf7344c442d9e0a4e2296;p=pulseview.git Enum: Use an iterator instead of iterating by indexes --- diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index 9044c6ba..71cd4315 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -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 >::const_iterator i = + _values.begin(); i != _values.end(); i++) + g_variant_unref((*i).first); } QWidget* Enum::get_widget(QWidget *parent, bool auto_commit)