diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index deea1a2e7..f0d0828ec 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -86,18 +86,12 @@ int RSGraphSource::n_values() const { return _points.size() ; } QString RSGraphSource::displayName(int i) const { - if(_points.empty()) - return QString() ; - - std::map > >::const_iterator it = _points.begin(); - int n=0; - for(it = _points.begin();it!=_points.end() && n > >::const_iterator it = _points.begin();it!=_points.end() ;++it) + if(n++ == i) + return QString::fromStdString(it->first) ; - if(n != i) - return QString("[error]"); - - return QString::fromStdString(it->first) ; + return QString("[error]"); } QString RSGraphSource::displayValue(float v) const