Is there a significant performance issues between the next 2 functions ?


Qt Code:
  1. void cos(QList<Complexo> &x, QList<Complexo> &y)
  2. {
  3. y.clear();
  4.  
  5. for(int i=0;i < x.size(); i++)
  6. {
  7. y.append(cos(x[i]));
  8. }
  9. }
  10.  
  11. QList<Complexo> cos(QList<Complexo> & x)
  12. {
  13. QList<Complexo> y;
  14.  
  15. for(int i=0;i < x.size(); i++)
  16. {
  17. y.append(cos(x[i]));
  18. }
  19.  
  20. return y;
  21. }
To copy to clipboard, switch view to plain text mode 

The second seems more elegant but returning a large QList, will be slower ?