mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 18:47:52 +02:00
* Make dictionary constructor behave as Delphi does in absence of comparer
This commit is contained in:
parent
63237dd375
commit
45cb7d1eff
@ -1059,7 +1059,11 @@ constructor TOpenAddressingDH<OPEN_ADDRESSING_CONSTRAINTS>.Create(ACapacity: Siz
|
||||
const AComparer: IExtendedEqualityComparer<TKey>);
|
||||
begin
|
||||
FMaxLoadFactor := TProbeSequence.DEFAULT_LOAD_FACTOR;
|
||||
FEqualityComparer := AComparer;
|
||||
// Delphi creates one if you pass nil...
|
||||
if aComparer=Nil then
|
||||
FEqualityComparer := TExtendedEqualityComparer<TKey>.Default(THashFactory)
|
||||
else
|
||||
FEqualityComparer := AComparer;
|
||||
SetCapacity(ACapacity);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user