Explorar el Código

* Micro-optimization. Fix issue #39617

Michaël Van Canneyt hace 3 años
padre
commit
2a19e152b7
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      rtl/objpas/classes/stringl.inc

+ 3 - 1
rtl/objpas/classes/stringl.inc

@@ -1476,6 +1476,8 @@ Var
   Obj : TObject;
   Str : String;
 begin
+  if (CurIndex=NewIndex) then 
+    Exit;
   BeginUpdate;
   Try
     Obj:=Objects[CurIndex];
@@ -1485,7 +1487,7 @@ begin
     InsertObject(NewIndex,Str,Obj);
   finally
     EndUpdate;
-    end;
+  end;
 end;
 
 function TStrings.Pop: string;