mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 22:26:00 +02:00
Ensure FindInsertNode only return -1, 0 or +1
git-svn-id: trunk@38788 -
This commit is contained in:
parent
827d6dc01f
commit
036560010f
@ -2875,12 +2875,15 @@ begin
|
||||
Result := Compare(ANode.Key,AInsertNode.Key);
|
||||
if Result < 0 then
|
||||
begin
|
||||
Result:=-1;
|
||||
if AInsertNode.Left = nil then
|
||||
Exit;
|
||||
AInsertNode := AInsertNode.Left;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if Result > 0 then
|
||||
Result:=1;
|
||||
if AInsertNode.Right = nil then
|
||||
Exit;
|
||||
AInsertNode := AInsertNode.Right;
|
||||
|
Loading…
Reference in New Issue
Block a user