SynEdit: fix for fpc 3.2.2: constref vs const

This commit is contained in:
Martin 2025-04-03 11:46:31 +02:00
parent 3eb2c20d38
commit 18030f9183

View File

@ -88,8 +88,13 @@ type
TLazHighlighterRangeEqualityComparer = class(TInterfacedObject, ILazHighlighterRangeEqualityComparer)
public
{$IF FPC_Fullversion>30202}
function Equals(const ALeft, ARight: TLazHighlighterRangeForDictionary): Boolean; reintroduce;
function GetHashCode(const AValue: TLazHighlighterRangeForDictionary): UInt32; reintroduce;
{$ELSE}
function Equals(constref ALeft, ARight: TLazHighlighterRangeForDictionary): Boolean; reintroduce;
function GetHashCode(constref AValue: TLazHighlighterRangeForDictionary): UInt32; reintroduce;
{$ENDIF}
end;
var
@ -109,14 +114,16 @@ end;
{ TLazHighlighterRangeEqualityComparer }
function TLazHighlighterRangeEqualityComparer.Equals(const ALeft,
ARight: TLazHighlighterRangeForDictionary): Boolean;
function TLazHighlighterRangeEqualityComparer.Equals(
{$IF FPC_Fullversion>30202} const {$ELSE} constref {$ENDIF}
ALeft, ARight: TLazHighlighterRangeForDictionary): Boolean;
begin
Result := ALeft.Compare(ARight) = 0;
end;
function TLazHighlighterRangeEqualityComparer.GetHashCode(
const AValue: TLazHighlighterRangeForDictionary): UInt32;
{$IF FPC_Fullversion>30202} const {$ELSE} constref {$ENDIF}
AValue: TLazHighlighterRangeForDictionary): UInt32;
begin
Result := AValue.GetHashCode;
end;