mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 21:50:18 +02:00
* Small optimization for comparing nil strings.
git-svn-id: trunk@35619 -
This commit is contained in:
parent
b0ad48c877
commit
2714a06e77
@ -719,21 +719,10 @@ Var
|
||||
cp1,cp2 : TSystemCodePage;
|
||||
begin
|
||||
if pointer(S1)=pointer(S2) then
|
||||
begin
|
||||
result:=0;
|
||||
exit;
|
||||
end;
|
||||
Exit(0);
|
||||
{ don't compare strings if one of them is empty }
|
||||
if (pointer(S1)=nil) then
|
||||
begin
|
||||
result:=-1;
|
||||
exit;
|
||||
end;
|
||||
if (pointer(S2)=nil) then
|
||||
begin
|
||||
result:=1;
|
||||
exit;
|
||||
end;
|
||||
if (pointer(S1)=nil) or (pointer(S2)=Nil) then
|
||||
Exit(-1);
|
||||
cp1:=TranslatePlaceholderCP(StringCodePage(S1));
|
||||
cp2:=TranslatePlaceholderCP(StringCodePage(S2));
|
||||
if cp1=cp2 then
|
||||
|
Loading…
Reference in New Issue
Block a user