Browse Source

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

Michaël Van Canneyt 3 years ago
parent
commit
59a7024d73
1 changed files with 2 additions and 0 deletions
  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))