if Assigned(X) then FreeAndNil(X): is the check faster? I measured it
Open the Delphi RTL source and you will find this pattern in many places: if Assigned(X) then FreeAndNil(X); FreeAndNil already copes with nil, so the “if” looks redundant. But there is a classic counter-argument: when X is mostly nil, the explicit test is faster, because it skips a procedure call. Opinions are cheap, so I […]
if Assigned(X) then FreeAndNil(X): is the check faster? I measured it Read More »
