Return to Snippet

Revision: 28872
at May 2, 2011 14:27 by jimfred


Updated Code
// SequenceEqual
byte[] myArray1 = new byte[] { 1, 2, 3, 4, 5 };
byte[] myArray2 = new byte[] { 1, 2, 3, 4, 5 };
Debug.Assert( myArray1.SequenceEqual(myArray2));

// GetHashCode
// Note, there's a one in 4,294,967,295 chance that this will provide a false equals
// http://mikehadlow.blogspot.com/2006/11/using-memorystream-and-binaryformatter.html
Debug.Assert( this.GetHashCode() == that.GetHashCode() );

Revision: 28871
at July 15, 2010 06:12 by jimfred


Initial Code
// Note, there's a one in 4,294,967,295 chance that this will provide a false equals
// http://mikehadlow.blogspot.com/2006/11/using-memorystream-and-binaryformatter.html
Debug.Assert( this.GetHashCode() == that.GetHashCode() );

Initial URL

                                

Initial Description
SequenceEqual

Initial Title
c#, deep compare

Initial Tags

                                

Initial Language
C#