diff --git a/Source/simba.array_algorithm.pas b/Source/simba.array_algorithm.pas index c5d3d7253..71d0d9f85 100644 --- a/Source/simba.array_algorithm.pas +++ b/Source/simba.array_algorithm.pas @@ -464,10 +464,10 @@ class function TArrayIndexOf.IndexOf(Item: _T; Arr: TArr): Integer; if (not IsManagedType(_T)) and (SizeOf(_T) in [1,2,4,8]) then begin case SizeOf(_T) of - 1: Result := IndexByte(Arr[0], Length(Arr) * SizeOf(_T), PByte(@Item)^); - 2: Result := IndexWord(Arr[0], Length(Arr) * SizeOf(_T), PWord(@Item)^); - 4: Result := IndexDWord(Arr[0], Length(Arr) * SizeOf(_T), PDWord(@Item)^); - 8: Result := IndexQWord(Arr[0], Length(Arr) * SizeOf(_T), PQWord(@Item)^); + 1: Result := IndexByte(Arr[0], Length(Arr), PByte(@Item)^); + 2: Result := IndexWord(Arr[0], Length(Arr), PWord(@Item)^); + 4: Result := IndexDWord(Arr[0], Length(Arr), PDWord(@Item)^); + 8: Result := IndexQWord(Arr[0], Length(Arr), PQWord(@Item)^); end; Exit; end;