Sfoglia il codice sorgente

* No change when clearing empty collection

git-svn-id: trunk@20780 -
michael 13 anni fa
parent
commit
1eca76dec5
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      rtl/objpas/classes/collect.inc

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

@@ -343,6 +343,8 @@ end;
 
 procedure TCollection.Clear;
 begin
+  if (FItems=Nil) or (FItems.Count=0) then
+    exit; // Prevent Changed
   BeginUpdate;
   try
     DoClear;