Is there a significant performance issues between the next 2 functions ?
void cos(QList<Complexo> &x, QList<Complexo> &y)
{
y.clear();
for(int i=0;i < x.size(); i++)
{
y.append(cos(x[i]));
}
}
QList<Complexo> cos(QList<Complexo> & x)
{
QList<Complexo> y;
for(int i=0;i < x.size(); i++)
{
y.append(cos(x[i]));
}
return y;
}
void cos(QList<Complexo> &x, QList<Complexo> &y)
{
y.clear();
for(int i=0;i < x.size(); i++)
{
y.append(cos(x[i]));
}
}
QList<Complexo> cos(QList<Complexo> & x)
{
QList<Complexo> y;
for(int i=0;i < x.size(); i++)
{
y.append(cos(x[i]));
}
return y;
}
To copy to clipboard, switch view to plain text mode
The second seems more elegant but returning a large QList, will be slower ?
Bookmarks