removed false positive access beyond range of iterator

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8436 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-14 12:48:12 +00:00
parent 50eff71bfa
commit c4a33eb0e0

View File

@ -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<std::string,std::list<std::pair<qint64,float> > >::const_iterator it = _points.begin();
int n=0;
for(it = _points.begin();it!=_points.end() && n<i;++it,++n) ;
if(n != i)
return QString("[error]");
for(std::map<std::string,std::list<std::pair<qint64,float> > >::const_iterator it = _points.begin();it!=_points.end() ;++it)
if(n++ == i)
return QString::fromStdString(it->first) ;
return QString("[error]");
}
QString RSGraphSource::displayValue(float v) const