Ejemplo n.º 1
0
 /// <summary>
 /// Compute a hash code for the current object.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     if (_hash == -1)
     {
         int hash = 0;
         for (int i = 0; i < count(); i++)
         {
             hash = Util.HashCombine(hash, Util.Hash(nth(i)));
         }
         this._hash = hash;
     }
     return(_hash);
 }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
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)));
 }