* Minor improvement of TFPSList.Expand

This commit is contained in:
Michaël Van Canneyt 2024-03-31 11:11:08 +02:00
parent 5c4f365be4
commit 33f6a9042d

View File

@ -680,12 +680,14 @@ var
IncSize : Longint; IncSize : Longint;
begin begin
if FCount < FCapacity then exit; if FCount < FCapacity then exit;
IncSize := 4; if FCapacity > 127 then
if FCapacity > 3 then IncSize := IncSize + 4; IncSize:=FCapacity shr 2
if FCapacity > 8 then IncSize := IncSize + 8; else if FCapacity > 8 then
if FCapacity > 127 then Inc(IncSize, FCapacity shr 2); IncSize := 16
if FCapacity+IncSize>MaxListSize then else if FCapacity > 3 then
IncSize:=MaxListSize-FCapacity; IncSize := 8
else
IncSize := 4;
// If we were at max capacity already, force error. // If we were at max capacity already, force error.
If IncSize<=0 then If IncSize<=0 then
IncSize:=1; // Will trigger error IncSize:=1; // Will trigger error