Re: ICollection(Of T) interface - Contains() method
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Tue, 11 Mar 2008 07:50:04 -0700
Mike wrote:
The goal is write efficient code for the Contains() method, which
doesn't rely on an exception to identify a particular return value.
As shown below, the code relies on an exception to return FALSE. To
me this method is inefficient, so I'm asking if anyone can suggest an
alternative.
I would just use one of the several specialized forms of Collection available,
instead of the fairly generic Collection.
Instead of
Protected _Collection as Collection
you could do
Protected _Collection as System.Collections.Specialized.HybridDictionary
or any of several choices which have a Contains method in them.
.
- References:
- Re: ICollection(Of T) interface - Contains() method
- From: Cor Ligthert[MVP]
- Re: ICollection(Of T) interface - Contains() method
- Prev by Date: Re: How to access MySettings from a DLL?
- Next by Date: Re: Max Cursor error using Oracle
- Previous by thread: Re: ICollection(Of T) interface - Contains() method
- Next by thread: Late Binding Problem - Need Help
- Index(es):
Relevant Pages
|