Ignore:
Timestamp:
Oct 28, 2010, 4:52:53 PM (14 years ago)
Author:
george
Message:
  • Added: Generic class TGDictionary and TGPair. Specialized class TDictionaryString.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Generic/ListImplementation.tpl

    r71 r72  
    118118begin
    119119  Result := 0;
    120   while (Result < FCount) and (FItems[Result] <> Item) do
     120  while (Result < FCount) and CompareMem(Addr(FItems[Result]), Addr(Item), SizeOf(TListItem)) do
    121121    Result := Result + 1;
    122122  if Result = FCount then Result := -1;
     
    191191end;
    192192
    193 procedure TGList.Swap(Index1, Index2: TListIndex);
    194 var
    195   Temp: TListItem;
    196 begin
    197   Temp := Items[Index1];
    198   Items[Index1] := Items[Index2];
    199   Items[Index2] := Temp;
    200 end;
    201 
    202193function TGList.Remove(Item: TListItem): TListIndex;
    203194begin
     
    230221  I := 0;
    231222  while I < (Count div 2) do begin
    232     Swap(I, Count - 1 - I);
     223    Exchange(I, Count - 1 - I);
    233224    I := I + 1;
    234225  end;
     
    241232end;
    242233
    243 procedure TGList.SetArray(Values: array of TListItem);
    244 var
    245   I: TListIndex;
    246 begin
    247   Clear;
     234procedure TGList.AddArray(Values: array of TListItem);
     235var
     236  I: TListIndex;
     237begin
    248238  I := 0;
    249239  while I <= High(Values) do begin
Note: See TracChangeset for help on using the changeset viewer.