浏览代码

* Micro-optimization. Fix issue #39617

Michaël Van Canneyt 3 年之前
父节点
当前提交
2a19e152b7
共有 1 个文件被更改,包括 3 次插入1 次删除
  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;