Your Ad Here

Posted By

jimfred on 07/15/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


c#, deep compare


 / Published in: C#
 

SequenceEqual

  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  

You need to login to post a comment.