[Lazarus] Redundant assigned(X) and (X is Txxx) in Laz. sources

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jan 12 23:23:44 CET 2018


On Fri, 12 Jan 2018 21:44:47 +0200
Juha Manninen via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> On Fri, Jan 12, 2018 at 8:38 PM, Vojtěch Čihák via Lazarus
> <lazarus at lists.lazarus-ide.org> wrote:
> > I wrote a small routine to search Lazarus sources and it found about 60
> > places similar to this (taborderdlg.pas, line 398):
> >
> > if Assigned(LookupRoot) and (LookupRoot is TWinControl) then begin
> >
> > Should I make a patch for all occurences?  
> 
> Yes, I think the patch would be applied.
> IIRC "is" was not allowed with Nil references in old FPC versions but
> it was a long time ago.

No, "is" was always checking for nil.
Maybe some people are confused by "as", which does not check for nil.

Mattias


More information about the Lazarus mailing list