<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>coordinate Issue Tracker Rss Feed</title><link>http://coordinate.codeplex.com/WorkItem/List.aspx</link><description>coordinate Issue Tracker Rss Description</description><item><title>Created Issue: high collisions in GetHashCode [9176]</title><link>http://coordinate.codeplex.com/workitem/9176</link><description>I really like this class but the implementation of GetHashCode produces high collisions. &lt;br /&gt;&lt;br /&gt;        public override int GetHashCode&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            return &amp;#40;latitude&amp;#43;longitude&amp;#41;.GetHashCode&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;Indeed with the current code any two coordinates with the same latitudinal longitudinal sum with cause collisions. So, these all have the same hash.&lt;br /&gt;&lt;br /&gt;    Coordinate&amp;#40;-1,6&amp;#41;&lt;br /&gt;    Coordinate&amp;#40;0,5&amp;#41;&lt;br /&gt;    Coordinate&amp;#40;1,4&amp;#41;&lt;br /&gt;    Coordinate&amp;#40;2,3&amp;#41;&lt;br /&gt;    Coordinate&amp;#40;3,2&amp;#41; &lt;br /&gt;    Coordinate&amp;#40;4,1&amp;#41;&lt;br /&gt;    Coordinate&amp;#40;5,0&amp;#41;&lt;br /&gt;    Coordinate&amp;#40;6,-1&amp;#41;&lt;br /&gt;&lt;br /&gt;You get the idea....&lt;br /&gt;&lt;br /&gt;Anyhow, something like the following will resolve the issue.&lt;br /&gt;&lt;br /&gt;        public override int GetHashCode&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            int hash &amp;#61; 13&amp;#59;&lt;br /&gt;            hash &amp;#61; &amp;#40;hash &amp;#42; 7&amp;#41; &amp;#43; latitude.GetHashCode&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            hash &amp;#61; &amp;#40;hash &amp;#42; 7&amp;#41; &amp;#43; longitude.GethashCode&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            return hash&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;</description><author>Fraserc</author><pubDate>Sat, 18 Feb 2012 11:15:34 GMT</pubDate><guid isPermaLink="false">Created Issue: high collisions in GetHashCode [9176] 20120218111534A</guid></item></channel></rss>