/// <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); }
/// <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> /// Compute the hash code for the symbol. /// </summary> /// <returns>The hash code.</returns> private int ComputeHashCode() { return(Util.HashCombine(_name.GetHashCode(), Util.Hash(_ns))); }