* Small optimization of WriteIdent. fixes issue #40334

This commit is contained in:
Michaël Van Canneyt 2023-06-29 23:48:10 +02:00
parent e776368ac8
commit c7109674d1

View File

@ -214,17 +214,12 @@ end;
procedure TBinaryObjectWriter.WriteIdent(const Ident: string); procedure TBinaryObjectWriter.WriteIdent(const Ident: string);
begin begin
{ Check if Ident is a special identifier before trying to just write Case UpperCase(Ident) of
Ident directly } 'NIL' : WriteValue(vaNil);
if UpperCase(Ident) = 'NIL' then 'FALSE' : WriteValue(vaFalse);
WriteValue(vaNil) 'TRUE' : WriteValue(vaTrue);
else if UpperCase(Ident) = 'FALSE' then 'NULL' : WriteValue(vaNull);
WriteValue(vaFalse) else
else if UpperCase(Ident) = 'TRUE' then
WriteValue(vaTrue)
else if UpperCase(Ident) = 'NULL' then
WriteValue(vaNull) else
begin
WriteValue(vaIdent); WriteValue(vaIdent);
WriteStr(Ident); WriteStr(Ident);
end; end;