mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 07:59:27 +02:00
* Small optimization of WriteIdent. fixes issue #40334
This commit is contained in:
parent
e776368ac8
commit
c7109674d1
@ -214,17 +214,12 @@ end;
|
||||
|
||||
procedure TBinaryObjectWriter.WriteIdent(const Ident: string);
|
||||
begin
|
||||
{ Check if Ident is a special identifier before trying to just write
|
||||
Ident directly }
|
||||
if UpperCase(Ident) = 'NIL' then
|
||||
WriteValue(vaNil)
|
||||
else if UpperCase(Ident) = 'FALSE' then
|
||||
WriteValue(vaFalse)
|
||||
else if UpperCase(Ident) = 'TRUE' then
|
||||
WriteValue(vaTrue)
|
||||
else if UpperCase(Ident) = 'NULL' then
|
||||
WriteValue(vaNull) else
|
||||
begin
|
||||
Case UpperCase(Ident) of
|
||||
'NIL' : WriteValue(vaNil);
|
||||
'FALSE' : WriteValue(vaFalse);
|
||||
'TRUE' : WriteValue(vaTrue);
|
||||
'NULL' : WriteValue(vaNull);
|
||||
else
|
||||
WriteValue(vaIdent);
|
||||
WriteStr(Ident);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user