mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 21:11:08 +02:00
rtl: don't convert strings on compare if one of them is empty
git-svn-id: trunk@19444 -
This commit is contained in:
parent
6bf90dfc7d
commit
908673e48b
@ -703,6 +703,17 @@ begin
|
|||||||
result:=0;
|
result:=0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
{ don't compare strings if one of them is empty }
|
||||||
|
if (pointer(S1)=nil) then
|
||||||
|
begin
|
||||||
|
result:=-Length(S2);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if (pointer(S2)=nil) then
|
||||||
|
begin
|
||||||
|
result:=Length(S1);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
cp1:=StringCodePage(S1);
|
cp1:=StringCodePage(S1);
|
||||||
cp2:=StringCodePage(S2);
|
cp2:=StringCodePage(S2);
|
||||||
if (cp1=cp2) then
|
if (cp1=cp2) then
|
||||||
|
Loading…
Reference in New Issue
Block a user