PRF009
TList instead of TObjectList
Object Pascal — Delphi & Free Pascal
Info
Performance
Untyped TList requires manual casting and lacks ownership semantics, increasing error risk
untyped TList requires manual casting and lacks ownership semantics, increasing error risk.
Why this severity
untyped TList requires manual casting and lacks ownership semantics, increasing error risk.
Known false positives
pointer lists that intentionally store non-object data.
Remediation example
var Orders: TObjectList<TOrder>; begin Orders := TObjectList<TOrder>.Create(True);
Related Performance rules