mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 01:49:20 +02:00
* Minor improvement of TFPSList.Expand
This commit is contained in:
parent
5c4f365be4
commit
33f6a9042d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user