Beispiel #1
0
        public static int SortByDBSizeMask(HashRec hx, HashRec hy)
        {
            ulong xx = hx.Index & SortMask;
            ulong yy = hy.Index & SortMask;

            return(xx == yy ? 0 : xx > yy ? 1 : -1);
        }
Beispiel #2
0
        public static int SortByFull(HashRec hx, HashRec hy)
        {
            ulong hx2 = BitConverter.ToUInt64(hx.FullHash, 8);
            ulong hx3 = BitConverter.ToUInt64(hx.FullHash, 16);

            ulong hy2 = BitConverter.ToUInt64(hy.FullHash, 8);
            ulong hy3 = BitConverter.ToUInt64(hy.FullHash, 16);

            return(hx.CompressedHash.CompareTo(hy.CompressedHash) + hx2.CompareTo(hy2) + hx3.CompareTo(hy3));
        }