Skip to content

Commit

Permalink
[collections] fixed exception if no results
Browse files Browse the repository at this point in the history
  • Loading branch information
exilon committed May 11, 2021
1 parent 80948a3 commit a4d91f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Quick.Collections.pas
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function TxList<T>.ExtractItem(const Value: T; Direction: TDirection): T;

function TxList<T>.First: T;
begin
Result := fList.First;
if fList.Count > 0 then Result := fList.First;
end;

procedure TxList<T>.FromList(const aList: TList<T>);
Expand Down Expand Up @@ -377,7 +377,7 @@ procedure TxList<T>.InsertRange(Index: Integer; const Values: array of T);

function TxList<T>.Last: T;
begin
Result := fList.Last;
if fList.Count > 0 then Result := fList.Last;
end;

function TxList<T>.LastIndexOf(const Value: T): Integer;
Expand Down

0 comments on commit a4d91f6

Please sign in to comment.