mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 09:56:12 +02:00
LCL: stringhashlist: disable range checking in hash function
git-svn-id: trunk@14255 -
This commit is contained in:
parent
8b91f41f9e
commit
9e72cfb939
@ -269,6 +269,8 @@ begin
|
|||||||
P:= PChar(Key);
|
P:= PChar(Key);
|
||||||
Len:= Length(Key);
|
Len:= Length(Key);
|
||||||
Result := Len;
|
Result := Len;
|
||||||
|
{$IFOPT R+}{$DEFINE RangeChecking}{$ENDIF}
|
||||||
|
{$R-}
|
||||||
// use the last 30 characters to compute the hash
|
// use the last 30 characters to compute the hash
|
||||||
case fCaseSensitive of
|
case fCaseSensitive of
|
||||||
True:
|
True:
|
||||||
@ -278,6 +280,7 @@ begin
|
|||||||
for I := Len - 1 downto 0 do
|
for I := Len - 1 downto 0 do
|
||||||
inc(Result, cardinal(ord(UpperCaseChars[P[I]])) shl I);
|
inc(Result, cardinal(ord(UpperCaseChars[P[I]])) shl I);
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF RangeChecking}{$R+}{$UNDEF RangeChecking}{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TStringHashList.Insert(Index: Integer; Item: PStringHashItem);
|
procedure TStringHashList.Insert(Index: Integer; Item: PStringHashItem);
|
||||||
|
Loading…
Reference in New Issue
Block a user