コード例 #1
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = StartPosition.GetHashCode();
         hashCode = (hashCode * 397) ^ EndPosition.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)MoveType;
         return(hashCode);
     }
 }
コード例 #2
0
ファイル: Variant.cs プロジェクト: sjmercer65/bio
        /// <summary>
        /// Serves as a hash function for a <see cref="Bio.Variant.Variant"/> object.
        /// </summary>
        /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
        /// hash table.</returns>
        public override int GetHashCode()
        {
            //TODO: This is a little unsafe as these fields are mutable...
            var h1 = RefName != null?RefName.GetHashCode() : 0;

            var h2 = StartPosition.GetHashCode();
            var h3 = EndPosition.GetHashCode();

            return(h1 ^ h2 ^ h3);
        }
コード例 #3
0
ファイル: LocalGroupOptions.cs プロジェクト: zz110/dnSpy
 /// <summary>
 /// GetHashCode()
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode() =>
 (ShowOffsetColumn ? int.MinValue : 0) ^
 (ShowValuesColumn ? 0x40000000 : 0) ^
 (ShowAsciiColumn ? 0x20000000 : 0) ^
 StartPosition.GetHashCode() ^
 EndPosition.GetHashCode() ^
 BasePosition.GetHashCode() ^
 (UseRelativePositions ? 0x10000000 : 0) ^
 OffsetBitSize ^
 (int)HexValuesDisplayFormat ^
 BytesPerLine;
コード例 #4
0
 /// <summary>
 /// GetHashCode()
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode() =>
 CharsPerLine.GetHashCode() ^
 BytesPerLine.GetHashCode() ^
 GroupSizeInBytes.GetHashCode() ^
 ShowOffset.GetHashCode() ^
 OffsetLowerCaseHex.GetHashCode() ^
 (int)OffsetFormat ^
 StartPosition.GetHashCode() ^
 EndPosition.GetHashCode() ^
 BasePosition.GetHashCode() ^
 UseRelativePositions.GetHashCode() ^
 ShowValues.GetHashCode() ^
 ValuesLowerCaseHex.GetHashCode() ^
 OffsetBitSize.GetHashCode() ^
 (int)ValuesFormat ^
 ShowAscii.GetHashCode() ^
 GetHexColumnTypeArrayHashCode(ColumnOrder);
コード例 #5
0
 public override int GetHashCode()
 {
     return(Mapping.GetHashCode() ^ ILRange.GetHashCode() ^ StartPosition.GetHashCode() ^ EndPosition.GetHashCode());
 }