mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
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:
parent
50eff71bfa
commit
c4a33eb0e0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user