소스 검색

* 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;