c#, deep compare


/ Published in: C#
Save to your folder(s)

SequenceEqual


Copy this code and paste it in your HTML
  1. // SequenceEqual
  2. byte[] myArray1 = new byte[] { 1, 2, 3, 4, 5 };
  3. byte[] myArray2 = new byte[] { 1, 2, 3, 4, 5 };
  4. Debug.Assert( myArray1.SequenceEqual(myArray2));
  5.  
  6. // GetHashCode
  7. // Note, there's a one in 4,294,967,295 chance that this will provide a false equals
  8. // http://mikehadlow.blogspot.com/2006/11/using-memorystream-and-binaryformatter.html
  9. Debug.Assert( this.GetHashCode() == that.GetHashCode() );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.