mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:16:05 +02:00
laz2_xml: fixed KeyCompare
git-svn-id: trunk@31705 -
This commit is contained in:
parent
e0b91a2f5e
commit
e5373a2852
@ -401,10 +401,10 @@ end;
|
|||||||
|
|
||||||
function KeyCompare(const Key1: TXMLUtilString; Key2: Pointer; Key2Len: Integer): Boolean;
|
function KeyCompare(const Key1: TXMLUtilString; Key2: Pointer; Key2Len: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
{$IFDEF FPC}
|
{$IF defined(FPC) and (SizeOf(TXMLUtilChar)=2)}
|
||||||
Result := (Length(Key1)=Key2Len) and (CompareWord(Pointer(Key1)^, Key2^, Key2Len) = 0);
|
Result := (Length(Key1)=Key2Len) and (CompareWord(Pointer(Key1)^, Key2^, Key2Len) = 0);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Result := (Length(Key1)=Key2Len) and CompareMem(Pointer(Key1), Key2, Key2Len*2);
|
Result := (Length(Key1)=Key2Len) and CompareMem(Pointer(Key1), Key2, Key2Len*SizeOf(TXMLUtilChar));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ begin
|
|||||||
Result := Entry^;
|
Result := Entry^;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
if FCount > FBucketCount then { arbitrary limit, probably too high }
|
if FCount > ((FBucketCount*7) div 8) then
|
||||||
begin
|
begin
|
||||||
Resize(FBucketCount * 2);
|
Resize(FBucketCount * 2);
|
||||||
Result := Lookup(Key, KeyLength, Found, CanCreate);
|
Result := Lookup(Key, KeyLength, Found, CanCreate);
|
||||||
|
Loading…
Reference in New Issue
Block a user