Browse Source

-- Zusammenführen von r13851 in ».«:
U rtl/objpas/fgl.pp

git-svn-id: branches/fixes_2_4@14189 -

florian 15 years ago
parent
commit
78fd1682f9
1 changed files with 5 additions and 8 deletions
  1. 5 8
      rtl/objpas/fgl.pp

+ 5 - 8
rtl/objpas/fgl.pp

@@ -357,15 +357,12 @@ procedure TFPSList.SetCount(NewCount: Integer);
 begin
 begin
   if (NewCount < 0) or (NewCount > MaxListSize) then
   if (NewCount < 0) or (NewCount > MaxListSize) then
     Error(SListCountError, NewCount);
     Error(SListCountError, NewCount);
+  if NewCount > FCapacity then
+    SetCapacity(NewCount);
   if NewCount > FCount then
   if NewCount > FCount then
-  begin
-    if NewCount > FCapacity then
-      SetCapacity(NewCount);
-    if NewCount > FCount then
-      FillByte(InternalItems[FCount]^, (NewCount-FCount) * FItemSize, 0)
-    else if NewCount < FCount then
-      Deref(NewCount, FCount-1);
-  end;
+    FillByte(InternalItems[FCount]^, (NewCount-FCount) * FItemSize, 0)
+  else if NewCount < FCount then
+    Deref(NewCount, FCount-1);
   FCount := NewCount;
   FCount := NewCount;
 end;
 end;