Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Neslib.Collections.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3455,8 +3455,6 @@ function TDictionary<TKey, TValue>.ContainsKey(const AKey: TKey): Boolean;

Index := (Index + 1) and Mask;
end;

Result := False;
end;

function TDictionary<TKey, TValue>.ContainsValue(const AValue: TValue): Boolean;
Expand Down Expand Up @@ -3541,6 +3539,8 @@ function TDictionary<TKey, TValue>.GetItem(const AKey: TKey): TValue;
var
Mask, Index, HashCode, HC: Integer;
begin
Result := Default(TValue);

if (FCount = 0) then
_GenericItemNotFoundError;

Expand Down Expand Up @@ -4042,7 +4042,7 @@ function TConcurrentDictionary<TKey, TValue>.Remove(const AKey: TKey): Boolean;
begin
FLock.Acquire;
try
FDictionary.Remove(AKey);
Result := FDictionary.Remove(AKey);
finally
FLock.Release;
end;
Expand Down Expand Up @@ -4160,8 +4160,6 @@ function TSet<T>.Contains(const AItem: T): Boolean;

Index := (Index + 1) and Mask;
end;

Result := False;
end;

constructor TSet<T>.Create(const AComparer: IEqualityComparer<T>);
Expand Down
6 changes: 3 additions & 3 deletions UnitTests/Tests/Tests.Collections.Base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,13 @@ procedure TTestCollectionBase<T>.ReleaseValue(const AValue: T);
begin
case FTypeInfo.Kind of
tkClass:
Obj.DisposeOf;
Obj.Free;

tkRecord:
if (FTypeInfo.NameFld.ToString = 'TFooBarRecord') then
begin
FB.Foo.DisposeOf;
FB.Bar.DisposeOf;
FB.Foo.Free;
FB.Bar.Free;
end;

tkDynArray:
Expand Down