> You can get dupes with GetHashCode(); but two objects with
> the same "value" must have the same hash code.
> I'll admit that Equals() must be overridden when
> GetHashCode() is overridden; but, I disagree that
> GetHashCode() is used wherever Equals() is used.
Heh I agree, though I thin
> At 02:49 PM 6/27/2005, Frans Bouma wrote (in part)
> >> There's been some discussion lately regarding the
> >> Object.GetHashCode() method.
> >>
> >> I think the concensus is pretty clear: for best
> reliability, classes
> >> that implement GetHashCode() should be immutable.
> >
> >Why? y
On 2005-06-27 21:19, Peter Ritchie wrote:
Hashtable.ContainsKey is basically looping until (entry.key.GetHashCode()
== keyParameter.GetHashCode() && entry.key.Equals(keyParameter)) == true.
To be clear: The hashtable actually uses a bit different algorithm. The
hash code is used to determine t
See comments below.
On Mon, 27 Jun 2005 15:37:18 -0400, J. Merrill <[EMAIL PROTECTED]> wrote:
>I think the right way to say it is that if the GetHashCode result
>is computed from values of one or more properties (or fields) of
>the object, those values must be immutable -- either that, or special
You can get dupes with GetHashCode(); but two objects with the
same "value" must have the same hash code.
I'll admit that Equals() must be overridden when GetHashCode() is
overridden; but, I disagree that GetHashCode() is used wherever Equals()
is used.
As with any hash, objects of save "value" *
At 02:49 PM 6/27/2005, Frans Bouma wrote (in part)
>> There's been some discussion lately regarding the
>> Object.GetHashCode() method.
>>
>> I think the concensus is pretty clear: for best reliability,
>> classes that implement GetHashCode() should be immutable.
>
>Why? you can also get du
> There's been some discussion lately regarding the
> Object.GetHashCode() method.
>
> I think the concensus is pretty clear: for best reliability,
> classes that implement GetHashCode() should be immutable.
Why? you can also get dupes with GetHashCode. It's not as if it's a
magic value.
There's been some discussion lately regarding the Object.GetHashCode()
method.
I think the concensus is pretty clear: for best reliability, classes that
implement GetHashCode() should be immutable.
Other than the Hashtable and ProperytCollection classes, does anyone know
where GetHashCode() is us