Browse Source

* Merging revisions 944 from trunk:
------------------------------------------------------------------------
r944 | michael | 2020-11-16 16:29:21 +0100 (Mon, 16 Nov 2020) | 1 line

* Assigned instead of <>Nil
------------------------------------------------------------------------

michael 4 years ago
parent
commit
79e245988b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/rtl/classes.pas

+ 3 - 3
packages/rtl/classes.pas

@@ -3958,7 +3958,7 @@ end;
 function TCollectionItem.GetIndex: Integer;
 
 begin
-  if FCollection<>nil then
+  if Assigned(FCollection) then
     Result:=FCollection.FItems.IndexOf(Self)
   else
     Result:=-1;
@@ -3971,8 +3971,8 @@ procedure TCollectionItem.SetCollection(Value: TCollection);
 begin
   IF Value<>FCollection then
     begin
-    If FCollection<>Nil then FCollection.RemoveItem(Self);
-    if Value<>Nil then Value.InsertItem(Self);
+    if Assigned(FCollection) then FCollection.RemoveItem(Self);
+    if Assigned(Value) then Value.InsertItem(Self);
     end;
 end;