mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-08 08:07:49 +02:00
Fixed a queue rebase function that allowed you to unqueue an item that didn't exist.
This commit is contained in:
parent
8df83483e4
commit
41fc39d1e9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user