コード例 #1
0
        private SymbObj(ushort id)
        {
            data      = SymbObjData(id);
            extraData = SymbObjExtraData();
            Debug.Assert(GetSymbId() == id);
            stringRepr = IdxToStr(id);

            // Calculating the hash code
            ulong hcode = 0;
            int   len   = stringRepr.Length;

            for (int i = 0; i < len; i++)
            {
                hcode = 31 * hcode + stringRepr[i];
            }
            hashcode = Hashing.Hashcode64(hcode);
        }
コード例 #2
0
ファイル: RecordObj.cs プロジェクト: cell-lang/csharp
 public override uint Hashcode()
 {
     if (hcode == Hashing.NULL_HASHCODE)
     {
         long hcode = 0;
         for (int i = 0; i < fieldIds.Length; i++)
         {
             hcode += Hashing.Hashcode(SymbObj.Get(fieldIds[i]).Hashcode(), col2[i].Hashcode());
         }
         hcode = Hashing.Hashcode64(hcode);
         if (hcode == Hashing.NULL_HASHCODE)
         {
             hcode++;
         }
     }
     return(hcode);
 }
コード例 #3
0
ファイル: FloatObj.cs プロジェクト: cell-lang/csharp
 public static uint Hashcode(double x)
 {
     return(Hashing.Hashcode64(Miscellanea.DoubleBitsToULongBits(x)));
 }