Re: efficency question
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 03/12/04
- Next message: Mark Rae: "Datagrid advice"
- Previous message: Miha Markic [MVP C#]: "Re: [Feature Request] Automatically Add using"
- In reply to: philipl_at_vistatec.ie: "efficency question"
- Next in thread: Daniel O'Connell [C# MVP]: "Re: efficency question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 12 Mar 2004 09:52:24 -0000
philipl@vistatec.ie <philipl@vistatec.ie> wrote:
> which is more efficient for looking up an element in an arraylist? An
> Arraylist.Contains? or Go throught it with a while or for loop?
I would imagine ArrayList.Contains is at least as efficient as anything
else, but more important is that it clearly states what you're after,
in a concise way. Always go for readability until you've got a reason
to believe that one piece of code is acting as a bottleneck.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Mark Rae: "Datagrid advice"
- Previous message: Miha Markic [MVP C#]: "Re: [Feature Request] Automatically Add using"
- In reply to: philipl_at_vistatec.ie: "efficency question"
- Next in thread: Daniel O'Connell [C# MVP]: "Re: efficency question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|