Beispiel #1
0
 bool Equals(UInt40 that)
 {
     return(this.b7 == that.b7 &&
            this.b6 == that.b6 &&
            this.b5 == that.b5 &&
            this.b4 == that.b4 &&
            this.b3 == that.b3);
 }
Beispiel #2
0
        public bool Contains(ulong hash)
        {
            UInt40 h = new UInt40(hash);
            int    i = (int)(hash & (ulong)(this.hashes.Length - 1));
            int    n = this.hashes[i] == null ? 0 : this.hashes[i].Length;

            for (int j = 0; j < n; j++)
            {
                if (this.hashes[i][j].Equals(h))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #3
0
 public void Add(ulong hash)
 {
     UInt40 h = new UInt40(hash);
       int i = (int)(hash & (ulong)(this.hashes.Length - 1));
       int n = this.hashes[i] == null ? 0 : this.hashes[i].Length;
       for (int j = 0; j < n; j++) {
     if (this.hashes[i][j].Equals(h)) return;
       }
       UInt40[] tmp = new UInt40[n+1];
       for (int j = 0; j < n; j++) {
     tmp[j] = this.hashes[i][j];
       }
       tmp[n] = h;
       this.hashes[i] = tmp;
       this.count++;
 }
Beispiel #4
0
        public void Add(ulong hash)
        {
            UInt40 h = new UInt40(hash);
            int    i = (int)(hash & (ulong)(this.hashes.Length - 1));
            int    n = this.hashes[i] == null ? 0 : this.hashes[i].Length;

            for (int j = 0; j < n; j++)
            {
                if (this.hashes[i][j].Equals(h))
                {
                    return;
                }
            }
            UInt40[] tmp = new UInt40[n + 1];
            for (int j = 0; j < n; j++)
            {
                tmp[j] = this.hashes[i][j];
            }
            tmp[n]         = h;
            this.hashes[i] = tmp;
            this.count++;
        }
Beispiel #5
0
 public bool Contains(ulong hash)
 {
     UInt40 h = new UInt40(hash);
       int i = (int)(hash & (ulong)(this.hashes.Length - 1));
       int n = this.hashes[i] == null ? 0 : this.hashes[i].Length;
       for (int j = 0; j < n; j++) {
     if (this.hashes[i][j].Equals(h)) return true;
       }
       return false;
 }
Beispiel #6
0
 bool Equals(UInt40 that)
 {
     return this.b7 == that.b7
       && this.b6 == that.b6
       && this.b5 == that.b5
       && this.b4 == that.b4
       && this.b3 == that.b3;
 }