Einzelnen Beitrag anzeigen

freimatz

Registriert seit: 20. Mai 2010
1.496 Beiträge
 
Delphi 11 Alexandria
 
#1

Spring IList - Capacity sinnvoll

  Alt 13. Jun 2025, 13:21
Ich habe da eine IList:
Delphi-Quellcode:
  Result := TPointList.Create() as IPointList;
  for i := 0 to numPoints - 1 do
    Result.Add(points[i]);
Macht es Sinn nach dem Create ein "Result.Capacity := numPoints" einzufügen? Vielleicht wegen Performance?
  Mit Zitat antworten Zitat