mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-06 06:15:50 +02:00
* Assigned instead of <>Nil
This commit is contained in:
parent
7944be97f0
commit
ba1d3b1145
@ -3958,7 +3958,7 @@ end;
|
|||||||
function TCollectionItem.GetIndex: Integer;
|
function TCollectionItem.GetIndex: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if FCollection<>nil then
|
if Assigned(FCollection) then
|
||||||
Result:=FCollection.FItems.IndexOf(Self)
|
Result:=FCollection.FItems.IndexOf(Self)
|
||||||
else
|
else
|
||||||
Result:=-1;
|
Result:=-1;
|
||||||
@ -3971,8 +3971,8 @@ procedure TCollectionItem.SetCollection(Value: TCollection);
|
|||||||
begin
|
begin
|
||||||
IF Value<>FCollection then
|
IF Value<>FCollection then
|
||||||
begin
|
begin
|
||||||
If FCollection<>Nil then FCollection.RemoveItem(Self);
|
if Assigned(FCollection) then FCollection.RemoveItem(Self);
|
||||||
if Value<>Nil then Value.InsertItem(Self);
|
if Assigned(Value) then Value.InsertItem(Self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user