Skip to content

Commit 3af5afd

Browse files
committed
Not using unsafe
1 parent f267246 commit 3af5afd

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Source/Base/Spring.Comparers.pas

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ interface
3939
TDefaultGenericInterface = Generics.Defaults.TDefaultGenericInterface;
4040

4141
TComparer<T> = record
42-
class function Default: IComparer<T>; static; {$IFDEF DELPHIX_TOKYO_UP}unsafe;{$ENDIF}
42+
class function Default: IComparer<T>; static;
4343
end;
4444

4545
TEqualityComparer<T> = record
46-
class function Default: IEqualityComparer<T>; static; {$IFDEF DELPHIX_TOKYO_UP}unsafe;{$ENDIF}
46+
class function Default: IEqualityComparer<T>; static;
4747
end;
4848

4949
THashFunction = function(const key; len: Cardinal; seed: Integer = 0): Integer;
@@ -91,20 +91,12 @@ function SameGuid(const left, right: TGUID): Boolean;
9191

9292
class function TComparer<T>.Default: IComparer<T>;
9393
begin
94-
{$IFDEF DELPHIX_TOKYO_UP}
95-
Pointer(Result) := _LookupVtableInfo(giComparer, TypeInfo(T), SizeOf(T));
96-
{$ELSE}
9794
Result := IComparer<T>(_LookupVtableInfo(giComparer, TypeInfo(T), SizeOf(T)));
98-
{$ENDIF}
9995
end;
10096

10197
class function TEqualityComparer<T>.Default: IEqualityComparer<T>;
10298
begin
103-
{$IFDEF DELPHIX_TOKYO_UP}
104-
Pointer(Result) := _LookupVtableInfo(giEqualityComparer, TypeInfo(T), SizeOf(T));
105-
{$ELSE}
10699
Result := IEqualityComparer<T>(_LookupVtableInfo(giEqualityComparer, TypeInfo(T), SizeOf(T)));
107-
{$ENDIF}
108100
end;
109101

110102
type

0 commit comments

Comments
 (0)