[Lazarus] property setter

xrfang xrfang at gmail.com
Thu Jan 24 03:08:24 CET 2013


Hi all,

Lazarus auto generated the following code for my class:

procedure TPainter.SetFont(AValue: TFont);
begin
  if FFont=AValue then Exit;
  FFont:=AValue;
end;

My question is, why the "if" clause needed? Is there any performance benefits?

Thanks,
Shannon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130124/5c73b129/attachment-0002.html>


More information about the Lazarus mailing list