Changeset 72 for Generics/TemplateGenerics/Generic/ListImplementation.tpl
- Timestamp:
- Oct 28, 2010, 4:52:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Generic/ListImplementation.tpl
r71 r72 118 118 begin 119 119 Result := 0; 120 while (Result < FCount) and (FItems[Result] <> Item) do120 while (Result < FCount) and CompareMem(Addr(FItems[Result]), Addr(Item), SizeOf(TListItem)) do 121 121 Result := Result + 1; 122 122 if Result = FCount then Result := -1; … … 191 191 end; 192 192 193 procedure TGList.Swap(Index1, Index2: TListIndex);194 var195 Temp: TListItem;196 begin197 Temp := Items[Index1];198 Items[Index1] := Items[Index2];199 Items[Index2] := Temp;200 end;201 202 193 function TGList.Remove(Item: TListItem): TListIndex; 203 194 begin … … 230 221 I := 0; 231 222 while I < (Count div 2) do begin 232 Swap(I, Count - 1 - I);223 Exchange(I, Count - 1 - I); 233 224 I := I + 1; 234 225 end; … … 241 232 end; 242 233 243 procedure TGList.SetArray(Values: array of TListItem); 244 var 245 I: TListIndex; 246 begin 247 Clear; 234 procedure TGList.AddArray(Values: array of TListItem); 235 var 236 I: TListIndex; 237 begin 248 238 I := 0; 249 239 while I <= High(Values) do begin
Note:
See TracChangeset
for help on using the changeset viewer.