@@ -94,7 +94,7 @@ TEnumerator = class(TRefCountedObject, IEnumerator<T>)
9494 procedure SetCapacity (value : Integer);
9595 procedure SetCount (value : Integer);
9696 procedure SetItem (index: Integer; const value : T);
97- procedure SetOwnsObjects (value : Boolean);
97+ procedure SetOwnsObjects (value : Boolean); inline;
9898 { $ENDREGION}
9999
100100 function TryGetElementAt (var value : T; index: Integer): Boolean;
@@ -496,7 +496,7 @@ function TAbstractArrayList<T>.GetRange(index, count: Integer): IList<T>;
496496
497497 Result := CreateList;
498498 list := TList<T>(Result.AsObject);
499- list.fCount := (list.fCount and not CountMask ) or count;
499+ list.fCount := (list.fCount and OwnsObjectsMask ) or count;
500500{ $IFDEF DELPHIXE2_UP}
501501 list.fItems := Copy(fItems, index, count);
502502{ $ELSE}
@@ -592,7 +592,7 @@ procedure TAbstractArrayList<T>.SetItemInternal(index: Integer; const value: T);
592592procedure TAbstractArrayList <T>.SetOwnsObjects(value : Boolean);
593593begin
594594 if TType.Kind<T> = tkClass then
595- fCount := (fCount and CountMask) or BitMask[ value ] ;
595+ fCount := (fCount and CountMask) or (Ord( value ) shl OwnsObjectsBitIndex) ;
596596end ;
597597
598598function TAbstractArrayList <T>.Single: T;
@@ -1102,7 +1102,7 @@ procedure TAbstractArrayList<T>.SetCount(value: Integer);
11021102 SetCapacity(value );
11031103 if value < Count then
11041104 DeleteRange(value , Count - value );
1105- fCount := (fCount and not CountMask ) or value ;
1105+ fCount := (fCount and OwnsObjectsMask ) or value ;
11061106end ;
11071107
11081108procedure TAbstractArrayList <T>.Delete(index: Integer);
0 commit comments