Fixed a queue rebase function that allowed you to unqueue an item that didn't exist.

This commit is contained in:
Henrique Gottardi Werlang 2024-04-19 09:37:05 -03:00 committed by Michael Van Canneyt
parent 8df83483e4
commit 41fc39d1e9

View File

@ -1907,15 +1907,16 @@ Var
I,Spare : integer;
begin
Spare:=Capacity-Count;
if FLow>0 then
begin
For I:=Flow to FLength do
begin
For I:=Flow to Pred(FLength) do
FItems[I-FLow]:=FItems[I];
SetLength(FItems,FLength+Spare);
FLength:=FLength-Flow+1;
FLength:=FLength-Flow;
Flow:=0;
end;
SetLength(FItems, FLength);
end;
end;
procedure TQueue<T>.TrimExcess;