瀏覽代碼

* Move() check for identical index. Additional fix for #39617

Michaël Van Canneyt 3 年之前
父節點
當前提交
59a7024d73
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      rtl/objpas/classes/lists.inc

+ 2 - 0
rtl/objpas/classes/lists.inc

@@ -261,6 +261,8 @@ var
 begin
   CheckIndex(CurIndex);
   CheckIndex(NewIndex);
+  if (CurIndex=NewIndex) then 
+    exit;
   Temp := FList^[CurIndex];
   if NewIndex > CurIndex then
     System.Move(FList^[CurIndex+1], FList^[CurIndex], (NewIndex - CurIndex) * SizeOf(Pointer))