Explorar o código

* Small optimization for comparing nil strings.

git-svn-id: trunk@35619 -
michael %!s(int64=8) %!d(string=hai) anos
pai
achega
2714a06e77
Modificáronse 1 ficheiros con 3 adicións e 14 borrados
  1. 3 14
      rtl/inc/astrings.inc

+ 3 - 14
rtl/inc/astrings.inc

@@ -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