Has anyone done any benchmarks to see if this slightly changed version of the previous code is slightly faster, due to caching the result of the count-1 call?
[pascal]
function TTextureSystem.FindItem(TexID: string): TTextureItem;
var
i : integer;
lCount : integerl
begin
lCount := count - 1;
for i := 0 to lCount do
if Items[i].TexId = TexID then
begin
result := Items[i];
break;
end;
end;
[/pascal]
Bookmarks