Advertisement
uniblab

Untitled

Dec 3rd, 2019
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. #region .ctor
  2. static Pair() {
  3.     theHashCode = typeof( Pair<TFirst, TSecond> ).AssemblyQualifiedName.GetHashCode();
  4.     unchecked {
  5.         theHashCode += typeof( TFirst ).AssemblyQualifiedName.GetHashCode();
  6.         theHashCode += typeof( TSecond ).AssemblyQualifiedName.GetHashCode();
  7.     }
  8. }
  9.  
  10. protected Pair() : base() {
  11.     myHashCode = theHashCode;
  12. }
  13. public Pair( TFirst first, TSecond second ) : this() {
  14.     myFirst = first;
  15.     mySecond = second;
  16.     unchecked {
  17.         if ( null != first ) {
  18.             myHashCode += first.GetHashCode();
  19.         }
  20.         if ( null != second ) {
  21.             myHashCode += second.GetHashCode();
  22.         }
  23.     }
  24. }
  25. #endregion .ctor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement