hash() private method

private hash ( object o ) : int
o object
return int
Example #1
0
        public override int GetHashCode()
        {
            int result = Util.hash(_tag);

            result = 31 * result + Util.hash(_form);
            return(result);
        }
Example #2
0
        public override int GetHashCode()
        {
            ISeq s = seq();

            if (s == null)
            {
                return(1);
            }
            return(Util.hash(s));
        }
Example #3
0
 /// <summary>
 /// Get the hash code for the current object.
 /// </summary>
 /// <returns>The hash code.</returns>
 /// <remarks>Result is cached.</remarks>
 public override int GetHashCode()
 {
     if (_hash == -1)
     {
         int hash = 0;
         for (ISeq s = seq(); s != null; s = s.next())
         {
             hash = Util.hashCombine(hash, Util.hash(s.first()));
         }
         _hash = hash;
     }
     return(_hash);
 }
 /// <summary>
 /// Computes a hash code for the current object.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 /// <remarks>The hash code is value-based (based on the items in the set).
 /// Once computed, the value is cached.</remarks>
 public override int GetHashCode()
 {
     if (_hash == -1)
     {
         int hash = 0;
         for (ISeq s = seq(); s != null; s = s.next())
         {
             object e = s.first();
             hash += Util.hash(e);
         }
         _hash = hash;
     }
     return(_hash);
 }
Example #5
0
 IFn FindFnFor(Type t)
 {
     if (_map != null)
     {
         Entry e = (Entry)_map[t];
         _mre = e;
         return(e != null ? e.Fn : null);
     }
     else
     {
         int idx = ((Util.hash(t) >> _shift) & _mask) << 1;
         if (idx < _table.Length && ((Type)_table[idx]) == t)
         {
             Entry e = ((Entry)table[idx + 1]);
             _mre = e;
             return(e != null ? e.Fn : null);
         }
         return(null);
     }
 }
Example #6
0
 /// <summary>
 /// Get the hash code.
 /// </summary>
 /// <returns>The hash code.</returns>
 public override int GetHashCode()
 {
     return(Util.hashCombine(_name.GetHashCode(), Util.hash(_ns)));
 }
Example #7
0
 /// <summary>
 /// Compute the hash code for the symbol.
 /// </summary>
 /// <returns>The hash code.</returns>
 private int ComputeHashCode()
 {
     return(Util.hashCombine(_name.GetHashCode(), Util.hash(_ns)));
 }
Example #8
0
 public override int GetHashCode()
 {
     return(Util.hash(seq()));
 }