LCL: stringhashlist: disable range checking in hash function

git-svn-id: trunk@14255 -
This commit is contained in:
mattias 2008-02-26 10:06:52 +00:00
parent 8b91f41f9e
commit 9e72cfb939

View File

@ -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);