Re: ICollection(Of T) interface - Contains() method

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.


.



Relevant Pages

  • Re: Byrns & Jute Plagiarize Magnequest Designs?
    ... content, not just for exception. ... matter at this time. ... L. has offered you his encouragement in your battle with Andre. ... WTF is "Mike L"? ...
    (rec.audio.tubes)
  • Re: Commercial Error Handler
    ... Kevin & Mike -- The request is for a desktop application. ... that wrote error information to log files and/or .mdb database file. ... The Microsoft Exception Application Block contains exception logging. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ResultSet is closed
    ... Mike B wrote: ... > searched all classes in this particular folder and I do not even have any of ... You probably print out the exception ... Chris Smith - Lead Software Developer/Technical Trainer ...
    (comp.lang.java.help)
  • Re: Criticisms of my Limewire listings and free disks
    ... Mike, while I take absolutely no exception to anything you've said in ... that the middle east was the cradle of civilization, ... not the middle east or even asia. ...
    (rec.pyrotechnics)
  • Re: Which is the most stable version of PHP ?
    ... but there is one exception. ... Space: disk usage analysis tool ...
    (comp.lang.php)