[nem-en] N.C.Hashtable behavior when the key is not found
Kamil Skalski
kamil.skalski at gmail.com
Fri Apr 7 13:43:27 CEST 2006
I'm suprised. I also thought it will throw exception now, as we
switched its implementation to SCG.Dictionary. I guess we should
change...
And one more thing, did you run 'svn blame'.., I'm a bit afraid it
will point on me though ;)
On 4/7/06, Michal Moskal <michal.moskal at gmail.com> wrote:
> Hi,
>
> Currently our Hashtable implementation, when the Item indexer is used,
> first checks if given key is in the underlaying S.C.G.Dictionary and
> if its not, it returns default value of given type. IMHO this is evil
> for several reasons:
> 1. S.C.G.Dictionary throws an exception in such case
> 2. the double check is bad performance-wise
> 3. it leads to hidden bugs, where you get default value instead of the exception
>
> I even assumed it would throw exception and always checked with
> Contains() first.
>
> Will anybody kill me dead when I change this to throw the exception?
>
> --
> Michal Moskal,
> http://nemerle.org/~malekith/
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list