Back

PRF012

Boxing in loop

Object Pascal — Delphi & Free Pascal
Info
Performance

Assigning value types to Variant inside loops causes repeated heap allocations

assigning value types to Variant inside loops causes repeated heap allocations.

Why this severity

assigning value types to Variant inside loops causes repeated heap allocations.


Known false positives

OLE automation code that requires Variant arrays.

Remediation example

var
  V: Integer; // use a concrete type inside the loop

Reconnecting… Connection lost. Reload